|
|
|
@ -90,10 +90,13 @@ TR_commManagerSelect(void * _this, TR_Event event) |
|
|
|
TR_Timer timer = (TR_Timer)event->data; |
|
|
|
TR_EventDispatcher dispatcher = (TR_EventDispatcher)event->subject; |
|
|
|
unsigned long timeout; // milliseconds |
|
|
|
unsigned long io_triggerd; |
|
|
|
|
|
|
|
if (! (TR_hashEmpty(this->read) |
|
|
|
&& TR_hashEmpty(this->write) |
|
|
|
&& TR_hashEmpty(this->accept))) { |
|
|
|
io_triggerd = TR_hashEach(this->write, this, commManagerIssueWriteEvents); |
|
|
|
io_triggerd += TR_hashEach(this->accept, this, commManagerIssueAcceptEvents); |
|
|
|
io_triggerd += TR_hashEach(this->read, this, commManagerIssueReadEvents); |
|
|
|
|
|
|
|
if (io_triggerd) { |
|
|
|
timeout = 0; |
|
|
|
} else if (NULL == timer) { |
|
|
|
timeout = TR_eventDispatcherGetDataWaitTime(dispatcher); |
|
|
|
@ -103,10 +106,6 @@ TR_commManagerSelect(void * _this, TR_Event event) |
|
|
|
|
|
|
|
TR_CALL(_this, TR_CommManager, select, event, timeout); |
|
|
|
|
|
|
|
TR_hashEach(this->write, this, commManagerIssueWriteEvents); |
|
|
|
TR_hashEach(this->accept, this, commManagerIssueAcceptEvents); |
|
|
|
TR_hashEach(this->read, this, commManagerIssueReadEvents); |
|
|
|
|
|
|
|
return TR_EVENT_DONE; |
|
|
|
} |
|
|
|
|
|
|
|
|