Browse Source

utilize update next poll event functionality from trevent

1.0.0
Georg Hopp 12 years ago
parent
commit
fbbcbc5791
  1. 1
      src/i_comm_manager.c
  2. 3
      src/server.c
  3. 2
      testers/testclient.sh

1
src/i_comm_manager.c

@ -65,6 +65,7 @@ TR_commManagerSelect(void * _this, TR_Event event)
} }
TR_CALL(_this, TR_CommManager, select, event, timeout); TR_CALL(_this, TR_CommManager, select, event, timeout);
TR_eventDispatcherUpdateNextPoll(dispatcher);
return TR_EVENT_DONE; return TR_EVENT_DONE;
} }

3
src/server.c

@ -43,7 +43,8 @@ serverCtor(void * _this, va_list * params)
{ {
TR_Server this = _this; TR_Server this = _this;
this->comm_manager = (TR_CommManager)TR_new(TR_CommManagerEpoll);
//this->comm_manager = (TR_CommManager)TR_new(TR_CommManagerEpoll);
this->comm_manager = (TR_CommManager)TR_new(TR_CommManagerPoll);
this->dispatcher = TR_new(TR_EventDispatcher, TR_EVD_SERVER, NULL, 100); this->dispatcher = TR_new(TR_EventDispatcher, TR_EVD_SERVER, NULL, 100);
this->connector = TR_new(TR_Connector); this->connector = TR_new(TR_Connector);
this->io_handler = TR_new(TR_IoHandler); this->io_handler = TR_new(TR_IoHandler);

2
testers/testclient.sh

@ -4,7 +4,7 @@ pids=""
i=0 i=0
while [ $i -lt 20 ] while [ $i -lt 20 ]
do do
dd if=/dev/zero bs=8192 count=25000 | nc -u localhost 5678 &
dd if=/dev/zero bs=8192 count=25000 | nc localhost 5678 &
pids="${pids} $!" pids="${pids} $!"
i=$((i + 1)) i=$((i + 1))
done done

Loading…
Cancel
Save