Commit fa0a87a0c78bc467e7352395278c1dd480b2f9af
1 parent
4a64f7dd
limit amount of accepts in one event to 100. This value might become configurable in future
Showing
2 changed files
with
3 additions
and
2 deletions
| ... | ... | @@ -53,12 +53,13 @@ static |
| 53 | 53 | TR_EventDone |
| 54 | 54 | connectorAccept(void * _this, TR_Event event) |
| 55 | 55 | { |
| 56 | + int count = 0; | |
| 56 | 57 | TR_Connector this = _this; |
| 57 | 58 | TR_CommEndPoint connection = (TR_CommEndPoint)event->subject; |
| 58 | 59 | TR_TcpSocket socket = TR_socketAccept( |
| 59 | 60 | (TR_TcpSocket)connection->transport); |
| 60 | 61 | |
| 61 | - while (socket) { | |
| 62 | + while (socket && count++ < 100) { | |
| 62 | 63 | TR_socketNonblock((TR_Socket)socket); |
| 63 | 64 | TR_Connection new_con = TR_new( |
| 64 | 65 | TR_Connection, | ... | ... |
Please
register
or
login
to post a comment