lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Global reference to pbufs


From: Kieran Mansley
Subject: Re: [lwip-users] Global reference to pbufs
Date: Fri, 20 May 2011 09:34:46 +0100

On Fri, 2011-05-20 at 09:45 +0200, Enrico Murador - Research &
Development - CET wrote:
> Hello,
> I'm sorry, I would need some more information...
> 
> I would know wether it is ok to call tcp_close() everytime the receive
> callback is called with NULL data pointer,

Yes.

> and wether it is safe to call tcp_write() (and tcp_output()) for a
> pcb, outside of callbacks, regardless of the
> pcb actual condition (e.g. when closing... Providing that the pcb is
> not deallocated, of course).

Yes provided that you are in a context that you know prevents there
being anything active in the stack at the same time.  There are lots of
ways to achieve this and it rather depends on how your port is
configured.  The easiest way to ensure this is to only call into lwIP
from the context that executes the rest of the stack.  E.g. if the stack
is executed in your main loop, then call tcp_write() from there; if the
stack executes in the tcpip_thread, request a callback (using
tcpip_callback) to execute tcp_write() 

Kieran




reply via email to

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