Simplifying tcp clien
closing connection on an error with handshake