IPv6 support added, segfaults fixed, more conservative use of file descriptors.