lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Socket recv of large message.


From: Patrick Klos
Subject: Re: [lwip-users] Socket recv of large message.
Date: Tue, 3 Oct 2017 08:50:45 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

On 10/3/2017 4:47 AM, Flavio Gobber wrote:
Hi lwip users,

I have implemeted an application with lwip on a blackfin board.
The stack is working with ping and TCP socket with short message, less than 1400 bytes. I need to implement a server which need to receive message large more than the length of 1400 bytes. What I see if the recv function return only a length of 1464 bytes, I can repeat the the recv function before to parse the message, but how can understand that the message is ended. This because the message doesn't have the length information and the length could change between a message and the Others.

TCP is a stream protocol, meaning that you can get any number of bytes at any time and there is no guarantee that they'll be received in the same sized chunks as they were sent.

You'll need to add length information to your protocol if the protocol has no other way to tell where "messages" start and stop.

Patrick Klos
Klos Technologies, Inc.




reply via email to

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