Move version check code to separate file
Change address family to AF_INET

This fixes socket() EAFNOSUPPORT error on Linux (worked perfectly on Windows!).