Update sockets

Fixed bug when server is being started in other thread