I just had a brilliant idea:
I just had a brilliant idea:
- Fork Indy
- Remove EIdConnClosedGracefully
- Call it Sindy, for Sane Indy
And with the unit prefixes it shouldn't be too difficult to pull of either I suppose.
- Fork Indy
- Remove EIdConnClosedGracefully
- Call it Sindy, for Sane Indy
And with the unit prefixes it shouldn't be too difficult to pull of either I suppose.
Hehe, I can share that sentiment.
ReplyDeleteif success
then raise ENothingBadHappened.Create('Relax');
Could require few if Status = SNAFU then iffing ;)
ReplyDeleteIt means the connection has been closed by the other side, gracefully sure, but closed still. So you cannot use the connection anymore.
ReplyDeleteThere is also a chance the connection was closed before your were done with whatever you were doing, and you may have to restart from scratch.
The server said "bye bye" and closed the connection, so that was graceful. Ungraceful is when you have a network error or got firewalled in the middle of the connection.
http://www.indyproject.org/kb/index.html?whydoikeepgettingeidconnc.htm
http://stackoverflow.com/questions/8295929/delphi-indy-eidconnclosedgracefully-makes-socket-unusable
Eric Grange My issue is that whether the server closing the connection is an exception is a protocol issue, not a socket issue.
ReplyDeleteIn all cases I've seen it's utterly irrelevant to the client if the connection was closed gracefully or not: either it's per protocol (ala SMTP or HTTP) in which case it's not an exception at all, or there's no meaningful difference between a "graceful" disconnect and a "non-graceful" disconnect.
Asbjørn Heid Just add the exception to the ignored ones in the IDE/debugger, it should be caught when meaningless.
ReplyDeleteAnd there is a difference between graceful or not
http://msdn.microsoft.com/en-us/library/windows/desktop/ms738547(v=vs.85).aspx
Eric Grange That doesn't help at runtime...
ReplyDeleteAn event like OnClosed seems more natural in this case than an exception. Reminds me about EAbort, it has its use.
ReplyDeleteEric Grange , that doesn't help when you have exception stack trace log files that keep filling up...
ReplyDelete