lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] re assembly problems


From: michelcky
Subject: Re: [lwip-users] re assembly problems
Date: Mon, 25 Oct 2010 16:26:54 +0200 (CEST)

>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.

OK. I'd try this way this morning. I used the select API to have timeout's benefit.
You confirm that we used the recv not properly.
But even if this solves our problem with a specific test soft,
our application cannot be designed like that because of the "grafcet interpretor"
I've already described.
So, now I'm sure there isn't another way, can we block the MTU, or can we impose it in a such way than
a routeur, for example, linked between the PC et our equipment doesn't choose its own value ?
Unfortunately, the application written with this grafcet runner cannot be modified.

Thanks, yours answers are so posthaste, it's very nice :)


> 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
>
>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]