Test using sockets in threads