0 votes
by (350 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
by (73.5k points)
selected by
 
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.

by (350 points)
Ok ..  is there something I can do in the short term to force the socket to close and then call dispose?
by (73.5k points)
Unfortunately not. You cannot do anything to make this working using current version.

But I can send you a 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).
asked Sep 23, 2020 by (620 points) This is still a problem for plain FTP session.
...