Added support for connecting to IPv6 servers.
eliminated compiler warnings