Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : Re: TCP client/server

www.cryer.info
Managed Newsgroup Archive

Re: TCP client/server

Subject:Re: TCP client/server
Posted by:"Jamie Dale" (j.da..@turboz.net)
Date:Tue, 6 Jun 2006 02:25:19

> The online tutorials are not always accurate or up-to-date.

If only you were writing them ;-)

> It is not a real solution, though.  It is a hack that hides the underlying
> problem, not fixes it.

Admitted lol. Still, it stops that blinkin popup message though doesn't
it!!!!!!!!!!!!!

> Indy is specifically designed to make heavy use of exceptions.  Exceptions
> are not errors, although they can be used to report errors.  Exceptions
> are
> a very OOP, and language-neutral, way to send notifications from one code
> block to another without having to process a bunch of error conditions in
> between just to decide how execution flow reaches each block.  If you
> don't
> like the way Indy is designed to work, then don't use it.  The VCL also
> makes heavy use of exceptions, but you use it anyway.  So please don't
> knock
> on Indy just because it follows the same kind of design principles.

My apologies. However please try to understand how annoying that popup
message is to those of us that are less experienced than yourself. To us, it
means nothing other than 'graceful' and it just becomes annoying! I don't
mean to slate Indy but the point is, when your not very experienced and
don't know what it means, the message is just a nuisance.


>  This is even documented in Indy's source code:
>
>  If this is a CLIENT
>  -------------------
>You should trap this error using a try..except.

Erm, isn't that what I've been saying?


> The Connected() method itself reads from the socket.  The only way to
> detect
> when a blocking socket has been closed is to read/write from it.  Though
> Connected() does prevent the EIdConnClosedGracefully exception from being
> thrown by Connected() itself.  But if you are checking Connected() before
> all of your reading/writing, then there is no way you can ever get
> EIdConnClosedGracefully unless the socket is closed while you are in the
> middle of a read/write operation.  In which case, raising
> EIdConnClosedGracefully is the correct thing for Indy to do.

Yeah that makes sense to me.

>> I introduced the try/except clause and that was the end of the problem.
>
> Hardly.  You put a bandage on it, nothing more.  You never fix the real
> issues.

I try to fix and in this case the fix was the Indy recommended Bandage which
you yourself posted!
Remy, I know my coding isn't perfect but at least I do try - gotta gimme
credit for that at least!

Replies:

In response to:

www.cryer.info
Managed Newsgroup Archive