[Top][All Lists]

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

[lwip-users] Clarification of LWIP and multi threading

From: David Hammerton
Subject: [lwip-users] Clarification of LWIP and multi threading
Date: Fri, 11 Feb 2011 14:41:59 +1100

Hi there,

I need a bit of clarification on using lwip in a multi-threaded environment. The wiki page (http://lwip.wikia.com/wiki/LwIP_and_multithreading) is a little vague, as is this email response: (http://www.mail-archive.com/address@hidden/msg07800.html)

I'm interested in if you can use a _single connection_ of the netconn api from two threads: one for sending, one for receiving. I'm also wondering what the best way to architect such a system is.

I need to be able to send out TCP data with minimal latency when possible - eg in response to some external hardware event. I also need to be listening on the same TCP connection and handling that data with minimal latency.

Can I have one thread waiting on netconn_recv, and send data with netconn_send at the same time?  By the looks of it, netconn_send goes through a message (either using a lock or a message queue), so I think it should be safe?

Also, how am I supposed to use the callback provided to netconn_new_with_proto_and_callback? Should I/Can I be calling netconn_recv in the thread context of the callback? If not, how can I abort a netconn_recv if, for example, I need to shut down the connection?

Thanks for any clarification you can offer.



David Hammerton

reply via email to

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