This should close the socket, not just set it to nil. Otherwise you have no control over when/if the socket is shutdown.