Added error message to socket.cpp