Skip to content

SSH.TCPTunnel.Listen

Andrew Lambert edited this page Nov 26, 2022 · 3 revisions

SSH.TCPTunnel.Listen

Method signature

 Sub Listen()

Remarks

Instructs the SSH server to begin listening on its local network interface(s), identified by RemoteAddress, for an inbound connection to RemotePort. If RemoteAddress is the empty string then the server will listen on all of its local interfaces. If RemotePort<=0 then the server will select a random ephemeral port to listen on, and the RemotePort property will be updated accordingly.

You must periodically call the Poll() method to poll the listener for activity. If a connection is received then the Connected() event will be raised. If an error occurs then the Error() event will be raised. Once connected you may read from and write to the tunnel like any other Channel.

This method listens for exactly one inbound connection and accepts the first one that arrives. To accept more than one inbound connection on the remote port refer to the TCPListener class.

See also

Clone this wiki locally