I followed the stacktrace to Renci.SshNet.Channels.ChannelDirectTcpip.InternalSocketSend
And change it from:
And change it from:
partial void InternalSocketSend(byte[] data)
{
this._socket.Send(data, 0, data.Length, SocketFlags.None);
}
to partial void InternalSocketSend(byte[] data)
{
try
{
this._socket.Send(data, 0, data.Length, SocketFlags.None);
}
catch (Exception exp)
{
Console.WriteLine("InternalSocketSend Exception: " + exp.Message + "\n" + exp.StackTrace);
}
}
Now the forwardings do not crash anymore in my use case.