Fix work with sockets