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("10.1.1.99", 22, user, pass);

client.Connect(): // this succeeds

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

client.AddForwardedPort(port);

// add port handlers

port.Start();  // times out here

IP 10.1.1.33 is localhost (me), and 10.1.1.99 is an SSH server.  I'm trying to forward any requests that go to 10.1.1.99:9000 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?