lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Telnet - Raw API


From: Noam Weissman
Subject: Re: [lwip-users] Telnet - Raw API
Date: Fri, 10 Mar 2017 17:03:20 +0000

Hi Sergio,


Long time :-) ...


Yes I am aware of what you wrote. Inside the recvfrom function this is actually what the

function is doing... copying in parts from the chained buffers until it gets all the data it

needs.


LwIP has sufficient RAM (22K) and PCB's (80) so it should be ok ?


Will continue the testing next week. Hope to have some insight why it happens...


Have a nice weekend,

Noam.






From: lwip-users <lwip-users-bounces+address@hidden> on behalf of Sergio R. Caprile <address@hidden>
Sent: Friday, March 10, 2017 2:22 PM
To: address@hidden
Subject: Re: [lwip-users] Telnet - Raw API
 
A pbuf can be a single one or a chain of them, and your app gets what
the rx driver got, so most likely you can't tell in advance and have to
be prepared to just deal with it.
If you can spare the memory, you can copy to a buffer and be happy. But
if you can't spare it, there are pbuf_ functions that provide some basic
operations for typical actions on typical application work; like
searching for a string.
In a web server, for example, you need to parse the host headers, but
they can come in several frames (due to TCP operation), and those frames
may themselves be chains of pbufs (due to memory fragmentation). A
common practice is to intentionally chain incoming pbufs until you get
the expected length, and then parse the pbuf chain for the expected
data. If memory is available, you might just copy everything to a big
enough buffer.




_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users
lists.nongnu.org
Welcome to the lwip-users mailing list. Use it to ask questions, share your experience and discuss new ideas. To see the collection of prior postings to the list ...


reply via email to

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