[fpc-pascal] lNet and TCP packet length
Bernd
prof7bit at googlemail.com
Sat Feb 4 14:31:38 CET 2012
2012/2/1 Malcolm Poole <malcolm at lingua-z.co.uk>:
> Before I set out to implement the procedures to do this myself, can someone
> reassure me that this needs to be done and that I am not re-inventing the
> wheel?
The TCP protocol will transparently split the data into the packets of
needed size without user intervention, so the sending site is probably
already ok.
But on the receiving side (at least with lNet) you will get a separate
event for each received packet and have to combine them again, so you
need to implement something on top of lNet to buffer and combine the
received chunks of data and only process it when one of your protocol
messages is complete. You need a robust way to determine how long your
protocol message is, at which byte exactly it ends and the next
message begins.
More information about the fpc-pascal
mailing list