As Grant B says, you have to put your own protocol inside to be
aboslutely sure!

However you do not have to go overboard.  TCP has already CRC'd your
data and will generally give it all to you and not miss bits out without
generating an error. 

I take this simple stategy

PRE-AMBLE followed by LENGTH followed by data DATA followed by POST
AMBLE

Now when things are running smoothly you should see the PRE calculate
where the POST should be from the length, then DATA is the bit in the
middle.   Now if you lose sync, you can go looking for the pre-amble and
when you find that, the length andpostamble (pretty unlikely to occur in
the DATA if you chose pre and post well.  You only have to do a sync
search if you lose sync and that will be as rare as hens teeth.   In
fact so rare you coiuld even pull the plug and start the session again
on failure.

There is an even simpler mechanism.   If you are moving ASCII you could
use control characters e.g. STX and ETX to mark the beginning and end of
the packet.

regards tony goodrich

> -----Original Message-----
> From: Peter Harrison IT [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, 14 July 1999 09:53
> To:   Multiple recipients of list delphi
> Subject:      RE: [DUG]:  TCP/IP Question
> 
> Hokay, - how can I tell when I have received a full record- ie all
> packets
> have been received from the clients send (multiple packets make a full
> record.)?
> 
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to