ipv6 support. improved connection routine