Multiple connections (General questions)
Hello,
In a utility that I write, I have a loop that checks if a specific folder is exist on a unix server, and if not - then it checks again (on the unix server) with an added prefix to this folder (e.g: it checks for folder1, folder2, folder3 etc.).
I write it here because I found that the only way that it 100 works, is to open a connection in the first time, and on the next times - if the connection is already opened, so firstable I close it, and then re-open it:
[code]
If Form1.ssh.State = Connected Then
Form1.ssh.Disconnect
End If
' re-open again...
[/code]
I know that this way consumes lots of connections and may reduce the performance, so I would like to know if there is a better way to do it, because when I tried to reuse an opened connection (as the next example), it is not always working:
[code]If Form1.ssh.State = Disconnected Then
' connect (again) ...
End If
If Form1.ssh.State = Connected Then
' reuse the exist connection...
End If[/code]
I know that the SSH has another states, but I don't know how to handle with all the rest. Closing the connection (as I made in the first example) seems to always work.
I found no relevant data in the attached PDF.
As I said, if there is any better way - please let me know.
Thanks in advance!