Just wrap data with a header and a trailer - ie

Psuedo-code:
                     |<----header------->|         |<--trailer->|
 send_data_buffer := 'H' + SizeOf(MyData) + MyData + CRC(MyData)

You can then process the first packet & know the length of the data &
thus when you have recieved the full amount of data.  Pretty similar to
implementing X-modem really..

Grant Black
Software Developer
SmartMove (NZ) Ltd
Phone:     +64 9 361-0219 extn 719
Fax  :     +64 9 361-0211
Email:     [EMAIL PROTECTED]


> -----Original Message-----
> From: Peter Harrison IT [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 14, 1999 9:53 AM
> 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.)?
> 
> >  -----Original Message-----
> > From:       [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> > Sent:       Tuesday, July 13, 1999 06:06 PM
> > To: Multiple recipients of list delphi
> > Subject:    RE: [DUG]:  TCP/IP Question
> > 
> > TCP has the concept of a session. So block B will 
> definitely be delivered
> > down a socket after block A.
> > 
> > The only think likely to confuse the receiving program is 
> the fact that
> > the receiving socket may get it in peculiar lumps. 
> > As long as the receiving program buffers it up till it has 
> a full 'record'
> > there should be no problems.
> > 
> > 
> --------------------------------------------------------------
> -------------
>     New Zealand Delphi Users group - Delphi List - 
> [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
> 
---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to