rewrite tests for sockets