Added test code for sockets