fix use of tcp sockets