|
From: | Rod Boyce |
Subject: | Re: [lwip-users] tcp_write function merges 2 different packets while sending |
Date: | Sat, 21 Dec 2019 22:34:54 +0000 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
Sir,
The packet definition is fine for normal generic multi-transport use. if you want to use TCP then on the receive side you want to read packet in either of the 2 ways below: 1. Just read to parse a header number of bytes, if packet valid read the number of data bytes + CRC, then process packet. Or 2. Read as much data as is available then search buffer for header & packet, save any leftover data. process packet. Then parse remainder of data, if another packet found process packet. If there is any leftover data once all packets have finished append new received data to end of left over data and start again. The 2nd option is more complicated but does not rely on data being stored in kernel buffers or network retries. This is commonly called a packet catcher. Regards, Rod
On 21/12/2019 18:23, Trampas Stern
wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |