close

open override fun close()

Close the socket. For a proxied socket this also tears down the SOCKS5 association (its kept- alive control connection, since the proxy drops the relay when it closes anyway), so an ephemeral proxied socket leaks nothing. The association's close() re-closes this same underlying socket, which is harmless. A direct socket just closes the socket.