Dear Sir:<br><br>I found a workaround to solve this problem:<br>Just reset the readSet before select():<br><br>void BasicTaskScheduler::SingleStep<div id="1fek" class="ArwC7c ckChnd">(unsigned maxDelayTime) {<br>.....</div>
{<br> HandlerIterator iter(*fReadHandlers);<br> HandlerDescriptor* handler;<br> FD_ZERO(&readSet);<br> while ((handler = iter.next()) != NULL) {<br> FD_SET((unsigned)handler->socketNum, &readSet);<br>
}<br> }<br> int selectResult = select(fMaxNumSockets, &readSet, NULL, NULL, &tv_timeToDelay);<br>...<br>}<br><br>It is strange since each fd in readSet can be selected individually and the fds seem the same as in fReadSet.<br>
So I force readSet to be reset for each socket number in handlers and it works finally.<br><br>BR.<br>Brain Lai<br>