Commit fa0a87a0c78bc467e7352395278c1dd480b2f9af

Authored by Georg Hopp
1 parent 4a64f7dd

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

@@ -53,12 +53,13 @@ static @@ -53,12 +53,13 @@ static
53 TR_EventDone 53 TR_EventDone
54 connectorAccept(void * _this, TR_Event event) 54 connectorAccept(void * _this, TR_Event event)
55 { 55 {
  56 + int count = 0;
56 TR_Connector this = _this; 57 TR_Connector this = _this;
57 TR_CommEndPoint connection = (TR_CommEndPoint)event->subject; 58 TR_CommEndPoint connection = (TR_CommEndPoint)event->subject;
58 TR_TcpSocket socket = TR_socketAccept( 59 TR_TcpSocket socket = TR_socketAccept(
59 (TR_TcpSocket)connection->transport); 60 (TR_TcpSocket)connection->transport);
60 61
61 - while (socket) { 62 + while (socket && count++ < 100) {
62 TR_socketNonblock((TR_Socket)socket); 63 TR_socketNonblock((TR_Socket)socket);
63 TR_Connection new_con = TR_new( 64 TR_Connection new_con = TR_new(
64 TR_Connection, 65 TR_Connection,
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 2
3 pids="" 3 pids=""
4 i=0 4 i=0
5 -while [ $i -lt 120 ] 5 +while [ $i -lt 800 ]
6 do 6 do
7 dd if=/dev/zero bs=8192 count=2500 | nc 192.168.2.13 5678 & 7 dd if=/dev/zero bs=8192 count=2500 | nc 192.168.2.13 5678 &
8 pids="${pids} $!" 8 pids="${pids} $!"
Please register or login to post a comment