Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Nov : Reading unknown amount of bytes from indy Client connection

www.cryer.info
Managed Newsgroup Archive

Reading unknown amount of bytes from indy Client connection

Subject:Reading unknown amount of bytes from indy Client connection
Posted by:"MVA" (m..@srcc.co.za)
Date:Fri, 17 Nov 2006 13:18:24

Hi,


My program will connect, using a TITCPClient component, to a external device
(Printer) with a i.p address. Then I will send a command to the device.
Depending on the command used, the printer will send variable amount of data
back to my program. Everything works fine up to this point.


The problem I now have is that I never know how many bytes the printer will
send back. What happens now is that when I run the command
IdTCPClient1.ReadBuffer(fReceive,FSize) I only receive part of the data.
FSize is only a guess at this point. What I need to know is how can I
determine that the TITCPClient component Receive buffer have received all
the data from the printer, before I read from the buffer.

Maybe a method to check the size of the Receive buffer until it stop growing
for x amount of time?


Hope my explanation is not to confusing.

Replies:

www.cryer.info
Managed Newsgroup Archive