Utility to test TCP connections with sockets