diff --git a/Renci.SshClient/Build/nuget/SSH.NET.nuspec b/Renci.SshClient/Build/nuget/SSH.NET.nuspec index 86b27f73..dd0bba58 100644 --- a/Renci.SshClient/Build/nuget/SSH.NET.nuspec +++ b/Renci.SshClient/Build/nuget/SSH.NET.nuspec @@ -2,7 +2,7 @@ SSH.NET - 2014.4.6-beta1 + 2014.4.6-beta2 SSH.NET Renci olegkap diff --git a/Renci.SshClient/Renci.SshNet/BaseClient.cs b/Renci.SshClient/Renci.SshNet/BaseClient.cs index 9b29ec01..b962fe91 100644 --- a/Renci.SshClient/Renci.SshNet/BaseClient.cs +++ b/Renci.SshClient/Renci.SshNet/BaseClient.cs @@ -257,22 +257,7 @@ namespace Renci.SshNet { CheckDisposed(); - // only send keep-alive message when we still have a session - if (Session != null) - { - // do not send multiple keep-alive messages concurrently - if (Monitor.TryEnter(_keepAliveLock)) - { - try - { - Session.TrySendMessage(new IgnoreMessage()); - } - finally - { - Monitor.Exit(_keepAliveLock); - } - } - } + SendKeepAliveMessage(); } /// @@ -401,6 +386,26 @@ namespace Renci.SshNet _keepAliveTimer = null; } + private void SendKeepAliveMessage() + { + // do nothing if we have disposed or disconnected + if (Session == null) + return; + + // do not send multiple keep-alive messages concurrently + if (Monitor.TryEnter(_keepAliveLock)) + { + try + { + Session.TrySendMessage(new IgnoreMessage()); + } + finally + { + Monitor.Exit(_keepAliveLock); + } + } + } + /// /// Starts the keep-alive timer. /// @@ -414,7 +419,7 @@ namespace Renci.SshNet return; if (_keepAliveTimer == null) - _keepAliveTimer = new Timer(state => SendKeepAlive()); + _keepAliveTimer = new Timer(state => SendKeepAliveMessage()); _keepAliveTimer.Change(_keepAliveInterval, _keepAliveInterval); } } diff --git a/Renci.SshClient/Renci.SshNet/ForwardedPortDynamic.cs b/Renci.SshClient/Renci.SshNet/ForwardedPortDynamic.cs index e90382fe..764c44ad 100644 --- a/Renci.SshClient/Renci.SshNet/ForwardedPortDynamic.cs +++ b/Renci.SshClient/Renci.SshNet/ForwardedPortDynamic.cs @@ -63,6 +63,7 @@ namespace Renci.SshNet /// Stops local port forwarding, and waits for the specified timeout until all pending /// requests are processed. /// + /// The maximum amount of time to wait for pending requests to finish processing. protected override void StopPort(TimeSpan timeout) { if (IsStarted) diff --git a/Renci.SshClient/Renci.SshNet/ForwardedPortLocal.cs b/Renci.SshClient/Renci.SshNet/ForwardedPortLocal.cs index 9352237f..f9d8561f 100644 --- a/Renci.SshClient/Renci.SshNet/ForwardedPortLocal.cs +++ b/Renci.SshClient/Renci.SshNet/ForwardedPortLocal.cs @@ -112,6 +112,7 @@ namespace Renci.SshNet /// Stops local port forwarding, and waits for the specified timeout until all pending /// requests are processed. /// + /// The maximum amount of time to wait for pending requests to finish processing. protected override void StopPort(TimeSpan timeout) { if (IsStarted) diff --git a/Renci.SshClient/Renci.SshNet/ForwardedPortRemote.cs b/Renci.SshClient/Renci.SshNet/ForwardedPortRemote.cs index f2e5624f..c84c7bb8 100644 --- a/Renci.SshClient/Renci.SshNet/ForwardedPortRemote.cs +++ b/Renci.SshClient/Renci.SshNet/ForwardedPortRemote.cs @@ -134,6 +134,7 @@ namespace Renci.SshNet /// /// Stops remote port forwarding. /// + /// The maximum amount of time to wait for pending requests to finish processing. protected override void StopPort(TimeSpan timeout) { // if the port not started, then there's nothing to stop diff --git a/Renci.SshClient/Renci.SshNet/IServiceFactory.cs b/Renci.SshClient/Renci.SshNet/IServiceFactory.cs index 86310612..49f69f69 100644 --- a/Renci.SshClient/Renci.SshNet/IServiceFactory.cs +++ b/Renci.SshClient/Renci.SshNet/IServiceFactory.cs @@ -24,7 +24,7 @@ namespace Renci.SshNet /// Creates a new in a given and with /// the specified operation timeout and encoding. /// - /// The to create the in. + /// The to create the in. /// The operation timeout. /// The encoding. /// diff --git a/Renci.SshClient/Renci.SshNet/Security/Cryptography/Hashes/SHA2HashBase.cs b/Renci.SshClient/Renci.SshNet/Security/Cryptography/Hashes/SHA2HashBase.cs index e45115a5..5526bd97 100644 --- a/Renci.SshClient/Renci.SshNet/Security/Cryptography/Hashes/SHA2HashBase.cs +++ b/Renci.SshClient/Renci.SshNet/Security/Cryptography/Hashes/SHA2HashBase.cs @@ -48,7 +48,7 @@ namespace Renci.SshNet.Security.Cryptography /// /// Initializes a new instance of the class. /// - public SHA2HashBase() + protected SHA2HashBase() { this._buffer = new byte[8]; diff --git a/Renci.SshClient/Renci.SshNet/ServiceFactory.cs b/Renci.SshClient/Renci.SshNet/ServiceFactory.cs index ca5a3b8e..3346c39a 100644 --- a/Renci.SshClient/Renci.SshNet/ServiceFactory.cs +++ b/Renci.SshClient/Renci.SshNet/ServiceFactory.cs @@ -27,7 +27,7 @@ namespace Renci.SshNet /// Creates a new in a given and with /// the specified operation timeout and encoding. /// - /// The to create the in. + /// The to create the in. /// The operation timeout. /// The encoding. ///