lwip-devel
[Top][All Lists]
Advanced

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

Re: [lwip-devel] Thoughts about callbacks on socket errors


From: Kieran Mansley
Subject: Re: [lwip-devel] Thoughts about callbacks on socket errors
Date: Tue, 19 Jun 2012 20:11:45 +0100

On 12 Jun 2012, at 19:21, Bill Auerbach wrote:
> When a socket is closed normally by the client, pcb->recv is called with
> struct pbuf *p == NULL to indicate the connection is closed.  If the client
> aborts the connection, pcb->errf is called.  If the application doesn't call
> tcp_err it doesn't get notified that the socket has closed by an error or
> abort.  I would think if pcb->errf is NULL that TCP_EVENT_RECV should be
> used with a NULL pbuf pointer.  The application might not handle errors or
> need to know if the socket closed because of an error but I think it should
> always be notified that the socket closed and it's consistent then in the
> use of tcp_recv to notify of the socket closing.

I can see what you're saying and the reasons for it, but I can also see the 
reasons for the way it is now.  Perhaps this would (as with all things) be 
improved by better documentation - there isn't a good reason for a user of the 
raw API to not specify an error handling callback (other than not realising 
it's necessary).

Kieran


reply via email to

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