lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Question about thread safety


From: Louis Wells
Subject: [lwip-users] Question about thread safety
Date: Thu, 24 Jan 2013 08:47:16 -0800

Hello,

I am currently using raw api in a system with FREERTOS. I am working on a simple dhcp server, and am not sure if I need to do anything special with my calls to the udp functions. 

I have a thread set up for tcpip, and another thread that is running a sort of main lwip task, which is used to determine whether or not my board is plugged into a network and use dhcp, or if no network is accessible and my board should act as a server to dole out an ip address to a directly connected laptop. 

From this main thread I have it set up so that dhcp will run for about 5 seconds, and if no offer comes in it will switch to dhcp server, and vice versa until a connection is established, I am also bringing the netif up and down from this thread depending on whether or not the phy sees a connection. 

the question I have is, I know i need to use tcpip_callback_with_block to modify the netif and dhcp from my other thread, but in my dhcp server code do I need to use tcpip_callback_with_block for all my calls to udp functions ? Such as when i am getting a new pcb and connecting it and so on.

Another related question is with the httpd.c that comes with the lwip code, am I going to need to change all the tcp calls to tcpip_callback_with_block ? 

thanks

reply via email to

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