lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] netconn - using in different tasks


From: Kieran Mansley
Subject: Re: [lwip-users] netconn - using in different tasks
Date: Wed, 13 May 2009 08:37:07 +0100

On Wed, 2009-05-13 at 08:31 +0200, ncoage wrote:
> Hi,
> 
> I'm using netconn API with callback function. In callback function I
> check the parameter len - if is greater than zero, I put a pointer to
> the netconn to queue. Another task reads the queue and use that
> netconn to parse data and send reply. This operation may takes several
> seconds. What if callback function will be called with parameter len
> equal zero? I know I must delete netconn, but another task may be
> using that netconn to send reply. I found some informations about that
> here http://lwip.wikia.com/wiki/LwIP_and_multithreading, but they dont
> explain all my doubts, or maybe I didnt understand them.

The simplest way of dealing with the len=0 case would be to still put
the netconn on your queue, together with some state that will allow the
other task to know that this connection should be closed, and get the
other task to delete it.

Kieran





reply via email to

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