slight modification to socket library.
additional logging added to socket.