diff --git a/src/i_comm_manager.c b/src/i_comm_manager.c index ee4cf84..781d78d 100644 --- a/src/i_comm_manager.c +++ b/src/i_comm_manager.c @@ -62,7 +62,6 @@ TR_commManagerSelect(void * _this, TR_Event event) timeout = TR_eventDispatcherGetDataWaitTime(dispatcher); } else { timeout = *timeoutptr; - TR_MEM_FREE(timeoutptr); } TR_CALL(_this, TR_CommManager, select, event, timeout); diff --git a/src/server.c b/src/server.c index 549ccac..c9b2371 100644 --- a/src/server.c +++ b/src/server.c @@ -43,7 +43,7 @@ serverCtor(void * _this, va_list * params) TR_Server this = _this; this->comm_manager = (TR_CommManager)TR_new(TR_CommManagerPoll); - this->dispatcher = TR_new(TR_EventDispatcher); + this->dispatcher = TR_new(TR_EventDispatcher, TR_EVD_SERVER, NULL, 100); this->connector = TR_new(TR_Connector); this->io_handler = TR_new(TR_IoHandler); this->protocol_handler = TR_new(TR_ProtocolHandler); diff --git a/testers/build.sh b/testers/build.sh index db1fdc3..fda4ed3 100755 --- a/testers/build.sh +++ b/testers/build.sh @@ -1,6 +1,7 @@ #!/bin/bash -TRLIBS="-ltrbase -ltrhashing -ltrio -ltrdata -ltrevent -ltrcomm" +#TRLIBS="-ltrbase -ltrhashing -ltrio -ltrdata -ltrevent -ltrcomm" +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" LIBS="-lcrypto -lssl -lrt -luuid" gcc ${CFLAGS} -c -o test_handler.o test_handler.c -gcc ${CFLAGS} -I/usr/local/include -L/usr/local/lib ${TRLIBS} ${LIBS} -o testserver testserver.c test_handler.o -gcc ${CFLAGS} -I/usr/local/include -L/usr/local/lib ${TRLIBS} ${LIBS} -o testserver2 testserver2.c test_handler.o +gcc ${CFLAGS} -I/usr/local/include -L/usr/local/lib ${LIBS} -o testserver testserver.c test_handler.o ${TRLIBS} +gcc ${CFLAGS} -I/usr/local/include -L/usr/local/lib ${LIBS} -o testserver2 testserver2.c test_handler.o ${TRLIBS} diff --git a/testers/testclient.sh b/testers/testclient.sh new file mode 100755 index 0000000..e7cb4ff --- /dev/null +++ b/testers/testclient.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +pids="" +i=0 +while [ $i -lt 400 ] +do + dd if=/dev/zero bs=8192 count=2500 | nc 192.168.2.13 5678 & + pids="${pids} $!" + i=$((i + 1)) +done + +wait ${pids}