mirror of
https://github.com/sshnet/SSH.NET.git
synced 2026-09-10 09:15:47 +00:00
Log warning upon timeout waiting for pending channels to reach zero.
This commit is contained in:
@@ -264,7 +264,12 @@ namespace Renci.SshNet
|
||||
partial void InternalStop(TimeSpan timeout)
|
||||
{
|
||||
_pendingChannelCountdown.Signal();
|
||||
_pendingChannelCountdown.Wait(timeout);
|
||||
if (!_pendingChannelCountdown.Wait(timeout))
|
||||
{
|
||||
// TODO: log as warning
|
||||
DiagnosticAbstraction.Log("Timeout waiting for pending channels in dynamic forwarded port to close.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
partial void InternalDispose(bool disposing)
|
||||
|
||||
@@ -214,7 +214,11 @@ namespace Renci.SshNet
|
||||
partial void InternalStop(TimeSpan timeout)
|
||||
{
|
||||
_pendingChannelCountdown.Signal();
|
||||
_pendingChannelCountdown.Wait(timeout);
|
||||
if (!_pendingChannelCountdown.Wait(timeout))
|
||||
{
|
||||
// TODO: log as warning
|
||||
DiagnosticAbstraction.Log("Timeout waiting for pending channels in local forwarded port to close.");
|
||||
}
|
||||
}
|
||||
|
||||
partial void InternalDispose(bool disposing)
|
||||
|
||||
@@ -201,7 +201,12 @@ namespace Renci.SshNet
|
||||
|
||||
// wait for pending channels to close
|
||||
_pendingChannelCountdown.Signal();
|
||||
_pendingChannelCountdown.Wait(timeout);
|
||||
|
||||
if (!_pendingChannelCountdown.Wait(timeout))
|
||||
{
|
||||
// TODO: log as warning
|
||||
DiagnosticAbstraction.Log("Timeout waiting for pending channels in remote forwarded port to close.");
|
||||
}
|
||||
|
||||
_status = ForwardedPortStatus.Stopped;
|
||||
}
|
||||
@@ -244,10 +249,7 @@ namespace Renci.SshNet
|
||||
{
|
||||
RaiseRequestReceived(info.OriginatorAddress, info.OriginatorPort);
|
||||
|
||||
using (
|
||||
var channel =
|
||||
Session.CreateChannelForwardedTcpip(channelOpenMessage.LocalChannelNumber,
|
||||
channelOpenMessage.InitialWindowSize, channelOpenMessage.MaximumPacketSize))
|
||||
using (var channel = Session.CreateChannelForwardedTcpip(channelOpenMessage.LocalChannelNumber, channelOpenMessage.InitialWindowSize, channelOpenMessage.MaximumPacketSize))
|
||||
{
|
||||
channel.Exception += Channel_Exception;
|
||||
channel.Bind(new IPEndPoint(HostAddress, (int) Port), this);
|
||||
|
||||
Reference in New Issue
Block a user