This project is read-only.

Port Forwarding is been stopping to slow !

Dec 19, 2014 at 4:09 PM
Edited Dec 19, 2014 at 4:10 PM
Hello there,
I have am testing the latest beta for resolving all the hugs i have on a tunnel.
When I enable port forwarding on a port on the exit of the application i am stopping all ports and disconnects from the server ! The code below shows what i am talking about:
   For I As Integer = 0 To mvarSSH.ForwardedPorts.Count - 1
        If mvarSSH.ForwardedPorts(I).IsStarted Then
        End If


  If Not mvarSSH Is Nothing Then
        If mvarSSH.IsConnected Then
        End If
      End If

      mvarSSH = Nothing

It stucks on the mvarSSH.ForwardedPorts(I).Stop() for over 1 minute and proceeds.. Why takes 1 minute to stop a port ?

In previous version of the SSH.NET the same command needed 2 secs to stop !

Am i doing something wrong ?
Dec 19, 2014 at 8:59 PM
Previous versions of SSH.NET did not wait for the forwarded ports to stop.
In the latest beta we attempt to do a clean stop which might mean waiting for the server to signal EOF or close the channel.
Should a forwarded port not stop normally within Connection.Timeout, then we'll just continue on.

Try subscribing to the ForwardedPort.Exception event to find out if any exceptions occur in the forwarded ports.

Note that you also no longer have to explicitly stop the forwarded ports.
This is done automatically when disconnecting or disposing the SshClient.
Dec 19, 2014 at 9:32 PM
Understood ! But Putty which is the client and i am using many times is not so slow ...or exiting ..or plink maybe !

Anyway since is in the exit of the application it is ok then !

I have to mention also that the beta is responding better in many cases or errors !

When a stable is about to be released ?
Dec 19, 2014 at 9:57 PM
If you can isolate a (not too elaborate) scenario that would allow me to reproduce the issue (and compare against putty), then I'll surely look into it.
I will probably also introduce a ConnectionInfo.CloseTimeout that would allow you to apply a different time-out to apply when closing SSH.NET (or specific channels).

I implemented a few more performance improvements since beta 2, we've identified some areas that we can still optimize.
This will have to wait until after the next stable though.

I hope to release a final beta next week.
The stable release should follow two to three weeks later (unless serious regressions are found).

Thanks for the feedback!
Dec 19, 2014 at 11:09 PM
Yes CloseTimeout would resolve the issue ...i think ! As i think now yes it is possible !

i will think about the scenario and come back !

Do you know approximately next week when will you release the next beta ?

I need to release a new version and i want to include the new library in it !
Jan 31, 2015 at 8:24 PM
Well it is a long time no news about the beta ? Will this issue be fixed finally ?
Jan 31, 2015 at 8:27 PM
I cannot find the connection timeout you are saying ... Where is that property ? Is which class ?