Updated to remove listener from socket, forward errors from socket to client