EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SImple SFTP connection protocol

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#23359
Posted: 02/07/2013 05:10:21
by Ian Hamlet (Standard support level)
Joined: 02/07/2013
Posts: 2

Currently I am using Version 10.0.230.
and i have a few instances where an exception is raised during the open() call.
The exception returned is Connection lost.

Should I or do I need to explicitly close the connection after a failed open,
subsequently when my application attempts retries the open call returns an exception Wrong socket state 4 in AsyncConnect (error code is 96258).

It is hard trying to engineer these circumstances in the lab so what is the corr3ect protocol for dealing with these open exceptions, and is there are way to check the underlying connection state

Ian
#23360
Posted: 02/07/2013 05:14:27
by Eugene Mayevski (EldoS Corp.)

You need to call Close() every time you call Open, no matter if Open succeeds or not.

The correct sequence would be

Code
try {
  Open();
  // do the job here;
}
finally
{
  try {
    Close();
  }
  catch(...)
  {}  
}


If you have such sequence and still get the problem, please let us know.


Sincerely yours
Eugene Mayevski
#23361
Posted: 02/07/2013 05:16:55
by Vsevolod Ievgiienko (EldoS Corp.)

Thank you for contacting us.

Quote
Should I or do I need to explicitly close the connection after a failed open,
subsequently when my application attempts retries the open call returns an exception Wrong socket state 4 in AsyncConnect (error code is 96258).

Yes you should call Close() method before a connection retry.

Please refer to next article for solution of exception problem: https://www.eldos.com/security/articles/4796.php
#23362
Posted: 02/07/2013 05:28:54
by Ian Hamlet (Standard support level)
Joined: 02/07/2013
Posts: 2

Thanks thats what i was expecting you to say, i was only closing if i had successfully opened.

Will implement, thansk for the speedy reply

Reply

Statistics

Topic viewed 1057 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!