ForwardedPortRemote Start() method times out

Sep 27, 2012 at 3:53 PM
Edited Sep 27, 2012 at 6:29 PM

The SSH.NET library times out on the following line in ForwardedPortRemote Start():


this.Session.WaitHandle(this ._globalRequestResponse);

My code looks like this:

var client = new SshClient("", 22, user, pass);

client.Connect(): // this succeeds

var port = new ForwardedPortRemote("", 9000, "", 443);


// add port handlers

port.Start();  // times out here

IP is localhost (me), and is an SSH server.  I'm trying to forward any requests that go to to myself on port 443 (https).  The code never returns from port.Start(), timing out at the WaitHandle() line.  Curiously, the forwarding actually is working until the timeout occurs.  What am I doing wrong?  Thanks.



Sep 27, 2012 at 4:00 PM
Edited Sep 27, 2012 at 8:00 PM

Sorry, one more detail.  When the timeout occurred on SSH.NET, the SSH Server simultaneously closed the connection with the error SSH Protocol error 11, which is packet too large.  Not sure if that adds any more clues.

I then created an ErrorOccurred event callback, and I get "Payload cannot be more than 32768 bytes." I then doubled the size of both MAXIMUM_PACKET_SIZE and MAXIMUM_PAYLOAD_SIZE and it now works.  Was that a bad thing to do?