diff --git a/src/Renci.SshNet/Channels/ChannelDirectTcpip.cs b/src/Renci.SshNet/Channels/ChannelDirectTcpip.cs
index 4b0b4754..b6ba7a0b 100644
--- a/src/Renci.SshNet/Channels/ChannelDirectTcpip.cs
+++ b/src/Renci.SshNet/Channels/ChannelDirectTcpip.cs
@@ -132,7 +132,15 @@ namespace Renci.SshNet.Channels
if (!_socket.IsConnected())
return;
- _socket.Shutdown(how);
+ try
+ {
+ _socket.Shutdown(how);
+ }
+ catch (SocketException ex)
+ {
+ // TODO: log as warning
+ DiagnosticAbstraction.Log("Failure shutting down socket: " + ex);
+ }
}
}
diff --git a/src/Renci.SshNet/Channels/ChannelForwardedTcpip.cs b/src/Renci.SshNet/Channels/ChannelForwardedTcpip.cs
index d09d78b6..7d731b9e 100644
--- a/src/Renci.SshNet/Channels/ChannelForwardedTcpip.cs
+++ b/src/Renci.SshNet/Channels/ChannelForwardedTcpip.cs
@@ -26,8 +26,20 @@ namespace Renci.SshNet.Channels
/// The remote channel number.
/// The window size of the remote party.
/// The maximum size of a data packet that we can send to the remote party.
- internal ChannelForwardedTcpip(ISession session, uint localChannelNumber, uint localWindowSize, uint localPacketSize, uint remoteChannelNumber, uint remoteWindowSize, uint remotePacketSize)
- : base(session, localChannelNumber, localWindowSize, localPacketSize, remoteChannelNumber, remoteWindowSize, remotePacketSize)
+ internal ChannelForwardedTcpip(ISession session,
+ uint localChannelNumber,
+ uint localWindowSize,
+ uint localPacketSize,
+ uint remoteChannelNumber,
+ uint remoteWindowSize,
+ uint remotePacketSize)
+ : base(session,
+ localChannelNumber,
+ localWindowSize,
+ localPacketSize,
+ remoteChannelNumber,
+ remoteWindowSize,
+ remotePacketSize)
{
}
@@ -116,7 +128,15 @@ namespace Renci.SshNet.Channels
if (!socket.IsConnected())
return;
- socket.Shutdown(how);
+ try
+ {
+ socket.Shutdown(how);
+ }
+ catch (SocketException ex)
+ {
+ // TODO: log as warning
+ DiagnosticAbstraction.Log("Failure shutting down socket: " + ex);
+ }
}
}
diff --git a/src/Renci.SshNet/Session.cs b/src/Renci.SshNet/Session.cs
index 812c0729..2dcce2b1 100644
--- a/src/Renci.SshNet/Session.cs
+++ b/src/Renci.SshNet/Session.cs
@@ -1796,8 +1796,8 @@ namespace Renci.SshNet
}
catch (SocketException ex)
{
- // TODO: log as info or debug
- DiagnosticAbstraction.Log("Failure shutting down socket or clearing read buffer: " + ex);
+ // TODO: log as warning
+ DiagnosticAbstraction.Log("Failure shutting down socket: " + ex);
}
}