This project is read-only.

Forwarded port is already added to a different client.

Jan 17, 2013 at 8:08 PM

Hello,

I have a textbox in a application that I am using for valiadation, by connectiong to my ssh server and using the portforward function of the ssh.net class. Works great to portforward to my mysql server for textbox input validation (email). However I am getting this error "Forwarded port is already added to a different client." when I try to validate another string of input into my textbox?

The validation WPF app is designed to connect to ssh server>portforward> when LostFocus event happens (click away from textbox). It connects, checks for validation of email and then disconnects from port and ssh server which is stated to fire within the LostFocus event.

If you  clear out text, write and fire the LostFocus event again you get "Forwarded port is already added to a different client." Any reason? I'll show my code if needed. Is the port forward not closing correctly? Do I need to create a new portforward connection everytime I connect?

 

Thanks,

Ben

 

 

Coordinator
Jan 17, 2013 at 8:13 PM

Hi,

 

This should happens in an event when you create a port object then add it to a client and after that you add it to different client then I throw this exception.

This was to prevent usage of the same port forwarding on two different clients.

 

Hope it helps.

 

Thanks,

Oleg

Jan 17, 2013 at 8:20 PM
Edited Jan 17, 2013 at 8:23 PM

Even if I close the client connection after the portforward stops?

 Public Sub DisconnectSSH()
        port.stop()

        client.Disconnect()
    End Sub

Sorry VB.  SO client.close would not be an option to close the client? I only want to use one instance of the client , then close the client when done.

Ben

 

Jan 17, 2013 at 8:24 PM

 Of course I could close the application  and reopen it to start the client again, but I want to use the client for one instance(close it) then open a new instance, multiple times (for validation). I realize most people write in C#. Any C# code would help as well.

Coordinator
Jan 17, 2013 at 8:39 PM

Hmm,

Then it seems to be a bug.

Currently it will work only if you use RemoveForwardedPort.

Can you log it as an issue so I will remeber to get back to it as I dont have time right now :(:(

 

Thanks,

Oleg

Jan 17, 2013 at 8:41 PM

Will do!

Thanks