Hello,
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?
Thanks,
Mike
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users