Created
March 31, 2014 10:13
-
-
Save darinkes/9889276 to your computer and use it in GitHub Desktop.
make portforwarding more stable Found while testing portforwarding with http and some real quick reloads. Port-Forwardings crashes when unable to ship data. https://sshnet.codeplex.com/discussions/446914
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Renci.SshNet/Channels/ChannelDirectTcpip.NET40.cs b/Renci.SshNet/Channels/ChannelDirectTcpip.NET40.cs | |
index c0518ce..dccca76 100644 | |
--- a/Renci.SshNet/Channels/ChannelDirectTcpip.NET40.cs | |
+++ b/Renci.SshNet/Channels/ChannelDirectTcpip.NET40.cs | |
@@ -21,7 +21,14 @@ namespace Renci.SshNet.Channels | |
partial void InternalSocketSend(byte[] data) | |
{ | |
- this._socket.Send(data, 0, data.Length, SocketFlags.None); | |
+ try | |
+ { | |
+ this._socket.Send(data, 0, data.Length, SocketFlags.None); | |
+ } | |
+ catch (Exception exp) | |
+ { | |
+ // XXX: ignore/log? | |
+ } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment