. Some protocol level messages may still be exchanged - so it is not necessarily the case that, just because the underlying socket is &quot;readable&quot;, that application data will be available to read.</p>

<p>When the connection is no longer required then it should be shutdown. A shutdown may be initiated by either the client or the server via a message known as a &quot;close_notify&quot; alert. The client or server that receives a close_notify may respond with one and then the connection is fully close