Class ConnectionInfo
Represents remote connection information class.
public class ConnectionInfo
- Inheritance
-
ConnectionInfo
- Derived
- Inherited Members
Remarks
This class is NOT thread-safe. Do not use the same ConnectionInfo with multiple client instances.
Constructors
ConnectionInfo(string, int, string, params AuthenticationMethod[])
Initializes a new instance of the ConnectionInfo class.
public ConnectionInfo(string host, int port, string username, params AuthenticationMethod[] authenticationMethods)
Parameters
host
stringThe host.
port
intThe port.
username
stringThe username.
authenticationMethods
AuthenticationMethod[]The authentication methods.
Exceptions
- ArgumentNullException
host
is null.- ArgumentException
username
is null, a zero-length string or contains only whitespace characters.- ArgumentOutOfRangeException
- ArgumentNullException
authenticationMethods
is null.- ArgumentException
No
authenticationMethods
specified.
ConnectionInfo(string, int, string, ProxyTypes, string, int, string, string, params AuthenticationMethod[])
Initializes a new instance of the ConnectionInfo class.
public ConnectionInfo(string host, int port, string username, ProxyTypes proxyType, string proxyHost, int proxyPort, string proxyUsername, string proxyPassword, params AuthenticationMethod[] authenticationMethods)
Parameters
host
stringConnection host.
port
intConnection port.
username
stringConnection username.
proxyType
ProxyTypesType of the proxy.
proxyHost
stringThe proxy host.
proxyPort
intThe proxy port.
proxyUsername
stringThe proxy username.
proxyPassword
stringThe proxy password.
authenticationMethods
AuthenticationMethod[]The authentication methods.
Exceptions
- ArgumentNullException
host
is null.- ArgumentException
username
is null, a zero-length string or contains only whitespace characters.- ArgumentOutOfRangeException
- ArgumentNullException
- ArgumentOutOfRangeException
proxyType
is not None andproxyPort
is not within MinPort and MaxPort.- ArgumentNullException
authenticationMethods
is null.- ArgumentException
No
authenticationMethods
specified.
ConnectionInfo(string, string, params AuthenticationMethod[])
Initializes a new instance of the ConnectionInfo class.
public ConnectionInfo(string host, string username, params AuthenticationMethod[] authenticationMethods)
Parameters
host
stringThe host.
username
stringThe username.
authenticationMethods
AuthenticationMethod[]The authentication methods.
Exceptions
- ArgumentNullException
host
is null.- ArgumentException
host
is a zero-length string.- ArgumentException
username
is null, a zero-length string or contains only whitespace characters.- ArgumentNullException
authenticationMethods
is null.- ArgumentException
No
authenticationMethods
specified.
Properties
AuthenticationMethods
Gets supported authentication methods for this connection.
public IList<AuthenticationMethod> AuthenticationMethods { get; }
Property Value
ChannelCloseTimeout
Gets or sets the timeout to use when waiting for a server to acknowledge closing a channel.
public TimeSpan ChannelCloseTimeout { get; set; }
Property Value
- TimeSpan
The channel close timeout. The default value is 1 second.
Remarks
If a server does not send a SSH_MSG_CHANNEL_CLOSE
message before the specified timeout
elapses, the channel will be closed immediately.
ChannelRequests
Gets the supported channel requests for this connection.
public IDictionary<string, RequestInfo> ChannelRequests { get; }
Property Value
- IDictionary<string, RequestInfo>
The supported channel requests for this connection.
ClientVersion
Gets the client version.
public string ClientVersion { get; }
Property Value
CompressionAlgorithms
Gets supported compression algorithms for this connection.
public IDictionary<string, Func<Compressor>> CompressionAlgorithms { get; }
Property Value
CurrentClientCompressionAlgorithm
Gets the current client compression algorithm.
public string CurrentClientCompressionAlgorithm { get; }
Property Value
CurrentClientEncryption
Gets the current client encryption.
public string CurrentClientEncryption { get; }
Property Value
CurrentClientHmacAlgorithm
Gets the current client hash algorithm.
public string CurrentClientHmacAlgorithm { get; }
Property Value
CurrentHostKeyAlgorithm
Gets the current host key algorithm.
public string CurrentHostKeyAlgorithm { get; }
Property Value
CurrentKeyExchangeAlgorithm
Gets the current key exchange algorithm.
public string CurrentKeyExchangeAlgorithm { get; }
Property Value
CurrentServerCompressionAlgorithm
Gets the current server compression algorithm.
public string CurrentServerCompressionAlgorithm { get; }
Property Value
CurrentServerEncryption
Gets the current server encryption.
public string CurrentServerEncryption { get; }
Property Value
CurrentServerHmacAlgorithm
Gets the current server hash algorithm.
public string CurrentServerHmacAlgorithm { get; }
Property Value
Encoding
Gets or sets the character encoding.
public Encoding Encoding { get; set; }
Property Value
Encryptions
Gets supported encryptions for this connection.
public IDictionary<string, CipherInfo> Encryptions { get; }
Property Value
HmacAlgorithms
Gets supported hash algorithms for this connection.
public IDictionary<string, HashInfo> HmacAlgorithms { get; }
Property Value
Host
Gets connection host.
public string Host { get; }
Property Value
- string
The connection host.
HostKeyAlgorithms
Gets supported host key algorithms for this connection.
public IDictionary<string, Func<byte[], KeyHostAlgorithm>> HostKeyAlgorithms { get; }
Property Value
IsAuthenticated
Gets a value indicating whether connection is authenticated.
public bool IsAuthenticated { get; }
Property Value
KeyExchangeAlgorithms
Gets supported key exchange algorithms for this connection.
public IDictionary<string, Func<IKeyExchange>> KeyExchangeAlgorithms { get; }
Property Value
MaxSessions
Gets or sets maximum number of session channels to be open simultaneously.
public int MaxSessions { get; set; }
Property Value
- int
The maximum number of session channels to be open simultaneously. The default value is 10.
Port
Gets connection port.
public int Port { get; }
Property Value
- int
The connection port. The default value is 22.
ProxyHost
Gets proxy connection host.
public string ProxyHost { get; }
Property Value
ProxyPassword
Gets proxy connection password.
public string ProxyPassword { get; }
Property Value
ProxyPort
Gets proxy connection port.
public int ProxyPort { get; }
Property Value
ProxyType
Gets proxy type.
public ProxyTypes ProxyType { get; }
Property Value
- ProxyTypes
The type of the proxy.
ProxyUsername
Gets proxy connection username.
public string ProxyUsername { get; }
Property Value
RetryAttempts
Gets or sets number of retry attempts when session channel creation failed.
public int RetryAttempts { get; set; }
Property Value
- int
The number of retry attempts when session channel creation failed. The default value is 10.
ServerVersion
Gets the server version.
public string ServerVersion { get; }
Property Value
Timeout
Gets or sets connection timeout.
public TimeSpan Timeout { get; set; }
Property Value
- TimeSpan
The connection timeout. The default value is 30 seconds.
Username
Gets connection username.
public string Username { get; }
Property Value
Events
AuthenticationBanner
Occurs when authentication banner is sent by the server.
public event EventHandler<AuthenticationBannerEventArgs> AuthenticationBanner