Added support for connecting to IPv6 servers (untested).