Improved the socket service.