[Top][All Lists]

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

[lwip-users] lwip recv callback questions

From: Mike He
Subject: [lwip-users] lwip recv callback questions
Date: Thu, 29 May 2014 10:50:23 -0700
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0


I am a new user to lwip with some questions on behavior of the callback function that receives data, i.e. the one specified by calling tcp_recv. I have tried looking on the wiki but was not able to find answers to my question specifically.

1. What do the different error codes that the recv callback can return mean, and how does lwip respond to them? For example, in my code I return ERR_ARG for a malformed request, but lwip repeatedly calls my callback with the same packet, seemingly forever. If I return ERR_OK, then the callback is only called once. On the Wiki, it seems to indicate that my callback should only be called a limited number of times if there is an error. (http://lwip.wikia.com/wiki/Raw/native_API). More generally, an explanation of when to use each ERR return and how to expect lwip to respond would be greatly appreciated.

2. pbuf_free(p) should be called on received packet only when we are happy with it and return ERR_OK, right?

3. Are we supposed to call tcp_accepted? The wiki states that it should be called from the tcp_accept callback to indicate that the connection is accepted, but I am working from example code provided by Texas Instruments using lwip, and they do not call the function anywhere. Is this a mistake on their part?


reply via email to

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