tcp-server accepting logic non thread-safe in same applications
Brought to you by:
s-vincent
In my client-server application I use libevent for a heavily accepting and manipulating with client connections (video streaming application). In your library you are using select() with precalculated max_sock identifier for non-blocking accept new connection, and in some time it can happens situation, when a system generated sock identifier in other program threads can match with your max_sock and then program state will be non consistent. In my patch I replace select() logic to poll() logic without using self generated sock identifier and problem has gone.
Thank you for the report.
Yes select() has some limitations, so change to poll() is a good idea.
In your patch, it misses the poll() for the TCP client socket descriptor. But anyway I will definitely replace the select() stuff by poll().
Available in 0.6 release.