Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : INDY 10 and timeouts

www.cryer.info
Managed Newsgroup Archive

INDY 10 and timeouts

Subject:INDY 10 and timeouts
Posted by:"David Hooker" (david.d.hook..@gmail.com)
Date:7 Jun 2006 20:01:53

Hi Team Indy


I am trying to talk to another computer with a protocol that I cannot
change (I have to implement a client for it, but I have no control over
it).

The protocol calls for an intercharacter timeout.  For example, if I am
expecting 100 bytes and there is more than 2 seconds between any two
bytes, I want a timeout exception.

However, an overall timeout would be close enough so as not to cause
any problems.  I noticed a method called ReadFromSource which looks
like it will do what I want, but it is marked as protected.   I would
like to call:

Connection.IOHandler.ReadBytes (100, 2000) and receive either 100
bytes; if they haven't arrived within 2000ms (or if the socket closes)
I should receive an exception.  Perhaps I have missed it, (and you can
tell me to RTF*), but how would I achieve that?


Also, I am seeing intermittent GPFs (and I don't know if it is caused
by Indy or if it is caused by my code yet) about reading from address 0
with value 0 (perhaps a null pointer somewhere) but I am having
difficulty driving Delphi 6's debugger in a multithreaded application
as it keeps on switching threads on me -- but has anyone else seen this?

Replies:

www.cryer.info
Managed Newsgroup Archive