Commit 87d711ff14cd504596870775ce024e892c859375
1 parent
415bff5e
Use c99 standard in build.sh and don't use TR_hashEmpty any more ... I probably …
…will deprecate all the empty functions soon
Showing
2 changed files
with
11 additions
and
12 deletions
@@ -90,10 +90,13 @@ TR_commManagerSelect(void * _this, TR_Event event) | @@ -90,10 +90,13 @@ TR_commManagerSelect(void * _this, TR_Event event) | ||
90 | TR_Timer timer = (TR_Timer)event->data; | 90 | TR_Timer timer = (TR_Timer)event->data; |
91 | TR_EventDispatcher dispatcher = (TR_EventDispatcher)event->subject; | 91 | TR_EventDispatcher dispatcher = (TR_EventDispatcher)event->subject; |
92 | unsigned long timeout; // milliseconds | 92 | unsigned long timeout; // milliseconds |
93 | + unsigned long io_triggerd; | ||
93 | 94 | ||
94 | - if (! (TR_hashEmpty(this->read) | ||
95 | - && TR_hashEmpty(this->write) | ||
96 | - && TR_hashEmpty(this->accept))) { | 95 | + io_triggerd = TR_hashEach(this->write, this, commManagerIssueWriteEvents); |
96 | + io_triggerd += TR_hashEach(this->accept, this, commManagerIssueAcceptEvents); | ||
97 | + io_triggerd += TR_hashEach(this->read, this, commManagerIssueReadEvents); | ||
98 | + | ||
99 | + if (io_triggerd) { | ||
97 | timeout = 0; | 100 | timeout = 0; |
98 | } else if (NULL == timer) { | 101 | } else if (NULL == timer) { |
99 | timeout = TR_eventDispatcherGetDataWaitTime(dispatcher); | 102 | timeout = TR_eventDispatcherGetDataWaitTime(dispatcher); |
@@ -103,10 +106,6 @@ TR_commManagerSelect(void * _this, TR_Event event) | @@ -103,10 +106,6 @@ TR_commManagerSelect(void * _this, TR_Event event) | ||
103 | 106 | ||
104 | TR_CALL(_this, TR_CommManager, select, event, timeout); | 107 | TR_CALL(_this, TR_CommManager, select, event, timeout); |
105 | 108 | ||
106 | - TR_hashEach(this->write, this, commManagerIssueWriteEvents); | ||
107 | - TR_hashEach(this->accept, this, commManagerIssueAcceptEvents); | ||
108 | - TR_hashEach(this->read, this, commManagerIssueReadEvents); | ||
109 | - | ||
110 | return TR_EVENT_DONE; | 109 | return TR_EVENT_DONE; |
111 | } | 110 | } |
112 | 111 |
@@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
2 | #TRLIBS="-ltrbase -ltrhashing -ltrio -ltrdata -ltrevent -ltrcomm" | 2 | #TRLIBS="-ltrbase -ltrhashing -ltrio -ltrdata -ltrevent -ltrcomm" |
3 | TRLIBS="/usr/local/lib/libtrcomm.a /usr/local/lib/libtrevent.a /usr/local/lib/libtrdata.a /usr/local/lib/libtrio.a /usr/local/lib/libtrhashing.a /usr/local/lib/libtrbase.a" | 3 | TRLIBS="/usr/local/lib/libtrcomm.a /usr/local/lib/libtrevent.a /usr/local/lib/libtrdata.a /usr/local/lib/libtrio.a /usr/local/lib/libtrhashing.a /usr/local/lib/libtrbase.a" |
4 | LIBS="-lcrypto -lssl -lrt -luuid" | 4 | LIBS="-lcrypto -lssl -lrt -luuid" |
5 | -gcc ${CFLAGS} -c -o test_handler.o test_handler.c | ||
6 | -gcc ${CFLAGS} -I/usr/local/include -L/usr/local/lib ${LIBS} -o testserver testserver.c test_handler.o ${TRLIBS} | ||
7 | -gcc ${CFLAGS} -I/usr/local/include -L/usr/local/lib ${LIBS} -o testserver2 testserver2.c test_handler.o ${TRLIBS} | ||
8 | -gcc ${CFLAGS} -I/usr/local/include -L/usr/local/lib ${LIBS} -o testtcp testclient.c ${TRLIBS} | ||
9 | -gcc ${CFLAGS} -I/usr/local/include -L/usr/local/lib ${LIBS} -DUDP=1 -o testudp testclient.c ${TRLIBS} | 5 | +gcc ${CFLAGS} -std=c99 -c -o test_handler.o test_handler.c |
6 | +gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -o testserver testserver.c test_handler.o ${TRLIBS} | ||
7 | +gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -o testserver2 testserver2.c test_handler.o ${TRLIBS} | ||
8 | +gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -o testtcp testclient.c ${TRLIBS} | ||
9 | +gcc ${CFLAGS} -std=c99 -I/usr/local/include -L/usr/local/lib ${LIBS} -DUDP=1 -o testudp testclient.c ${TRLIBS} |
Please
register
or
login
to post a comment