Back to product page

ConnectedEvent event


Fires when wodSSH.NET successfully connects to the server.

Syntax

  • C#
  • VB.NET
delegate void ConnectedDelegate(object Sender, ConnectedArgs Args);
The ConnectedEvent(Args.Error) syntax has these parts:
Args.ErrorException. Error that occurred during connection, if any.

Delegate Sub ConnectedDelegate( ByVal Sender As Object, ByVal Args As ConnectedArgs)
The ConnectedEvent(Args.Error) syntax has these parts:
Args.ErrorException. Error that occurred during connection, if any.

Remarks

Connected event will be fired always after Connect method is issued. If wodSSH.NET successfully connected to server, you can start sending/receiving data from server. If there is an error in connecting, Args.Error property will hold error description (Message) that describes the error.

For SSH protocols, it is possible that wodSSH.NET will internally negotiate connection parameters, before Connected event is fired at all. This is done to make wodSSH.NET as much transparent to protocol used as possible. You might notice packets transmitted to/from server in the meantime, meaning wodSSH.NET connected already but is still negotiating protocol parameters.
After this event is fired, please check Protocol property as you might see it changed internally by wodSSH.NET. This is possible if you set it to SSHAuto. wodSSH.NET will negotiate possible SSH protocol version, and change Protocol property accordingly.

Platforms

Windows