lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] lwip recv callback questions


From: Sergio R. Caprile
Subject: Re: [lwip-users] lwip recv callback questions
Date: Fri, 30 May 2014 18:06:51 -0300
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

> 1. Can you point me to a description of how to use the different error
codes, then?

Just follow the goto 3

>> 1: [...] goto 3;
>> 3: [...] check the available examples in the contrib tree: SMTP for a 
>> client, netio/httpserver_raw for a server

AFAIK callback functions return ERR_OK when they do take the data and ERR_ABRT 
when there is an error and they expect the stack to dispose of the data. Check 
(for example) http_recv() in httpd.c. If there is any other possible situation, 
it doesn't come to my mind right now.


On 30/05/2014 02:47 p.m., Sergio R. Caprile wrote:
> Hi, following is MY opinion (and experience)
>
> 1: Since the callback function is called by the stack as I instructed, I
> wouldn´t answer with ERR_ARG, since arg is just as I instructed the
> stack to call me... so, if you still do it because you don't trust the
> stack, then don't rely on it to stop calling you the wrong way... goto 3;
> 2: Once you tcp_recvd() those bytes and answer ERR_OK, you are the owner
> of the pbuf, you can free it when you want. Remember that that memory
> won't be available to hold new packets until you release it.
> 3: Vendors do what they think will sell more. I wouldn't use their
> examples as a learning tool for lwIP. Instead, check the available
> examples in the contrib tree: SMTP for a client, netio/httpserver_raw
> for a server
>
> Regards
>


-- 
-------------------------------------------------
Sergio R. Caprile, Human Being, Bs.As., Argentina
Electronics Engineer, Musician (guitarist), TaoFx 
        http://www.scaprile.ldir.com.ar/
-------------------------------------------------




reply via email to

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