"Åke Forslund" <[email protected]> wrote:
> I'm not quite sure how to handle the situation since when using blocking
> sockets lwip_read() doesn't return even if the link goes down (? is this
> expected behavior?)

A link-down event shouldn't cause read() to abort, I guess, since you could 
re-plug the device into the same network again.

A netif-down event (which is what stopping DHCP does) however should cause the 
read() to abort since the IP address is gone.

> so I can't use a semaphore to ensure that socket functions
> can't be accessed at the same time as the netifapi_*()-functions.
> 
> Any advice on how to handle link-status changes together with sockets in a
> safe manner would be great.

I'm not aware of problems here. As far as I know, there should be no problems 
with what you described. As you are having problems, I don't have any 
suggestions except for debugging to see which threads are pending on which 
semaphores, I'm afraid. A stack trace of all threads at the time of suspected 
deadlock would be helpful to give more hints.

Simon
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to