Browse Source

limit amount of accepts in one event to 100. This value might become configurable in future

1.0.0
Georg Hopp 11 years ago
parent
commit
fa0a87a0c7
  1. 3
      src/connector.c
  2. 2
      testers/testclient.sh

3
src/connector.c

@ -53,12 +53,13 @@ static
TR_EventDone TR_EventDone
connectorAccept(void * _this, TR_Event event) connectorAccept(void * _this, TR_Event event)
{ {
int count = 0;
TR_Connector this = _this; TR_Connector this = _this;
TR_CommEndPoint connection = (TR_CommEndPoint)event->subject; TR_CommEndPoint connection = (TR_CommEndPoint)event->subject;
TR_TcpSocket socket = TR_socketAccept( TR_TcpSocket socket = TR_socketAccept(
(TR_TcpSocket)connection->transport); (TR_TcpSocket)connection->transport);
while (socket) {
while (socket && count++ < 100) {
TR_socketNonblock((TR_Socket)socket); TR_socketNonblock((TR_Socket)socket);
TR_Connection new_con = TR_new( TR_Connection new_con = TR_new(
TR_Connection, TR_Connection,

2
testers/testclient.sh

@ -2,7 +2,7 @@
pids="" pids=""
i=0 i=0
while [ $i -lt 120 ]
while [ $i -lt 800 ]
do do
dd if=/dev/zero bs=8192 count=2500 | nc 192.168.2.13 5678 & dd if=/dev/zero bs=8192 count=2500 | nc 192.168.2.13 5678 &
pids="${pids} $!" pids="${pids} $!"

Loading…
Cancel
Save