[Top][All Lists]

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

Re: [lwip-users] Socket read/write and threads

From: Nicolas Pinault
Subject: Re: [lwip-users] Socket read/write and threads
Date: Mon, 11 Jan 2010 10:33:30 +0100
User-agent: Thunderbird (Windows/20090812)


Simon Goldschmidt a écrit :
2. Keep Rx and Tx threads locked and waiting on a select running in
another thread (in essence adding the locking mechanism that lwIP does
not support)

The idea is good, but it's not what lwIP doesn't support, since you don't get full duplex but mutual exclusion for read & write. Full duplex would allow simultaneously sending and receiving on the wire. However, that's the best you can get, currently, when using sockets.

My problem is not to simultaneously receive and transmit data.
My problem is that I have an application that receives data and transmit data asynchronously.
My application is a vnc server.
Vnc server receives data from client when, for example, the user moves the mouse or hits keys.
Vnc server sends screen content to client when needed.
The client can request the server to force send screen content. In this case, no problem.
But vnc server can also need to send screen content while nothing is received.
Two threads are ideal in this situation. One for receiving commands and one for sending screen content.

I can't see any other solution than using select with a short timeout.



reply via email to

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