How to force a SFTP.Connect to abort.

0 votes
asked Jul 27 by tom.abcd (320 points)

In one thread I have this:
_client = New Sftp
_client.Connect(ipaddress, ipport) ' timeout on connect is 6 seconds

In another thread
_client.Dispose()

I can see that Dispose() will finish while Connect is still timing out.

Is there a way to force Connect to Abort immediately and be done by the time Dispose returns?

If no way to abort THEN is there something I can wait on to make sure Connect has returned?

Would ConnectAsync help? and if so how?

Thanks
Tom

1 Answer

0 votes
answered Jul 30 by Lukas Matyska (47,190 points)
selected Jul 30 by tom.abcd
 
Best answer

This behavior is caused by the fact, that the Dispose method is not called on the currently connecting socket.

We classified this as a bug. It will be fixed in next public release.

commented Jul 30 by tom.abcd (320 points)
Ok ..  is there something I can do in the short term to force the socket to close and then call dispose?
commented Jul 30 by Lukas Matyska (47,190 points)
Unfortunately not. You cannot do anything to make this working using current version.

But I can send you BETA version. If you are registered user, please send your order details to support@rebex.net and I will share a link to full BETA version.

If you are just evaluating the product, please comment here (if you want to receive the trial BETA version now).
...