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.

Comments

  1. Hehe, I can share that sentiment.  

    if success
     then raise ENothingBadHappened.Create('Relax');

    ReplyDelete
  2. Could require few if Status = SNAFU then iffing ;)

    ReplyDelete
  3. It means the connection has been closed by the other side, gracefully sure, but closed still. So you cannot use the connection anymore.

    There 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

    ReplyDelete
  4. Eric Grange My issue is that whether the server closing the connection is an exception is a protocol issue, not a socket issue. 

    In 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.

    ReplyDelete
  5. Asbjørn Heid Just add the exception to the ignored ones in the IDE/debugger, it should be caught when meaningless.

    And there is a difference between graceful or not
    http://msdn.microsoft.com/en-us/library/windows/desktop/ms738547(v=vs.85).aspx

    ReplyDelete
  6. Eric Grange That doesn't help at runtime...

    ReplyDelete
  7. An event like OnClosed seems more natural in this case than an exception. Reminds me about EAbort, it has its use.

    ReplyDelete
  8. Eric Grange , that doesn't help when you have exception stack trace log files that keep filling up...

    ReplyDelete

Post a Comment