ppp aaa
|
select() not triggering the 2nd file descriptor.
|
ppp aaa
01/24/2008 9:59 PM
post4580
|
select() not triggering the 2nd file descriptor.
Hi,
I am using select() to demux 2 file descriptors. It appears that whichever file descriptor grabs select()'s attention
first will always work, whereas the other one will not never trigger. I had test both file descriptors outside the
select() scope and they do receive data properly.
I'm using code that looks similar to another project that ran on Linux system, so I think my syntax is correct. I'm
curious if I'm suppose to reset some kind of flag at the end of the select() scope.
My code looks like this
while(1) {
rv = select( ... )
if( rv > 0 ) {
if( ISSET( fd1, &set ) )
read( fd1, ... )
if( ISSET( fd2, &set ) )
read( fd2, ... )
} //only the essentials are here. Same structure works on Linux
Am I missing something here? I'm using the C++ compiler and running my code on QNX Neutrino 6.2 host on a VMware virtual
machine.
Thank you!
|
|
|