EldoS | Feel safer!

Software components for data protection, secure storage and transfer

AS2 over HTTPS Example

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
#24173
Posted: 03/19/2013 10:10:51
by Eugene Mayevski (EldoS Corp.)

Quote
John Anderson wrote:
Can you explain what effect the Silent argument on ElHTTPSServer.Close(bool silent) has on the exceptions thrown? The name implies that if set true the Close just happens without any protest... is that the case?


Not exactly. When Silent is set to true, the TCP shutdown phase (4 packets going back and forth) is omitted and only the local socket itself is closed. This is not good for the server as the socket on the server side stays opened for quite a long time. So wherever possible you need to use Silent = false. NOTE that even with Silent = true the exception can happen as the exception will be a translation of Winsock error and error is always possible. Practically you need to wrap *any* call with try/catch and be ready for exceptions that can happen.


Sincerely yours
Eugene Mayevski
#24174
Posted: 03/19/2013 10:15:10
by John Anderson (Priority Standard support level)
Joined: 03/15/2013
Posts: 24

Yes, I already saw that documentation about Silent. However it says:-

Silent - specifies if the server should send a disconnection notification to the client.

This method causes TElHTTPSServer to gracefully close SSL session. Call this method after application has finished using the connection and is about to close it.

It doesn't seem to close it gracefully and if I set silent to true there is no exception returned... is this the correct use of silent? To prevent the exception?

Does the 1.5 second delay cause the m_httpsServ above continue existing after the Close has been called because the Dispose doesn't seem to remove the object in my tests.
#24175
Posted: 03/19/2013 10:18:49
by Eugene Mayevski (EldoS Corp.)

Quote
John Anderson wrote:
It doesn't seem to close it gracefully and if I set silent to true there is no exception returned... is this the correct use of silent? To prevent the exception?


No, it's not.
Quote
John Anderson wrote:
Does the 1.5 second delay cause the m_httpsServ above continue existing after the Close has been called because the Dispose doesn't seem to remove the object in my tests.


By calling Dispose you mark the object as disposed, but the object is not "destroyed". In .NET it must not be used anymore, but it will be destroyed only after garbage collector collects this object.


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 4871 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!