Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - select() not triggering the 2nd file descriptor.: (2 Items)
   
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!
Re: select() not triggering the 2nd file descriptor.  
Opps, never mind. I forgot that FD_SET should be within the while loop. Thus my select() is left in a half working state
.