The socket must be a new socket or an existing closed socket. A non-closed socket is not available to be reused. Calling on
a non-closed socket will raise an error.
If an error happens on a socket, the socket is automatically closed thus is ready for reuse.
Establish a plain TCP connection, or a TLS handshake.