c - accept() blocks (while pending connections) -


i've noticed weird problem accept. have server runs on freebsd , client runs on windows .

everything works fine, i've started make stress tests. i've noticed after 1000 connections

the client, server stops accepting new connections. idea why ?

i'm guessing tcp protocol handshake, did else noticed ? solutions ?

server

    socket() // ipv4     bind()     listen(... , 0xffff)      while (true) {         sock=accept(socket, null, null);         if (sock<=0)             break;         close(sock);     } 

client

    int count=0;     while (true) {         count++;         socket(...)         connect(...)         close(...)         fprintf(stderr, "count: %i\r", count);     } 

after 1000 connections or so, server blocks in accept.

i've set kern.ipc.maxsockets 65535, no effect.

you don't seem testing errors. suggest that. suspect find problem client has stopped connecting, due port exhaustion.

this kind of testing proves nothing. aren't going have single clients connect , disconnect @ maximum rate.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -