Working sockets implementation