|
From: | michelcky |
Subject: | Re: [lwip-users] re assembly problems |
Date: | Mon, 25 Oct 2010 16:26:54 +0200 (CEST) |
> Message du 25/10/10 16:00
> De : "Kieran Mansley"
> A : "Mailing list for lwIP users"
> Copie à :
> Objet : Re: [lwip-users] re assembly problems
>
>
> On Mon, 2010-10-25 at 15:30 +0200, address@hidden wrote:
> >
> > On Mon, 25 Oct 2010 13:59:29 +0100, Kieran Mansley
> > wrote:
> > > TCP or UDP? The two handle fragmentation rather differently.
> > >
> >
> > Hi,
> >
> > Using TCP only. We don't try UDP.
>
> OK, that's easy then: it's up to the application to deal with
> fragmentation. TCP delivers a stream of bytes with no guarantees about
> the block size that the stream will be delivered in at the receiver. It
> could pass you one byte at a time if it wished (although that would be
> very inefficient of course!). Or it could combine many writes into a
> single big block at the receiver.
>
> In your case I would structure the app something like this:
>
> 1) read 2 bytes to find the size of message.
>
> 2a) try to read message-size-bytes.
> 2b) if you get less than message-size-bytes loop to read the rest of the
> message until you've got all you want.
>
> Kieran
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
[Prev in Thread] | Current Thread | [Next in Thread] |