Browse Source

preparation for edge triggerd events and add a small testscript for paralell testing.

1.0.0
Georg Hopp 11 years ago
parent
commit
2ee7035dc7
  1. 1
      src/i_comm_manager.c
  2. 2
      src/server.c
  3. 7
      testers/build.sh
  4. 12
      testers/testclient.sh

1
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);

2
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);

7
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}

12
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}
Loading…
Cancel
Save