select and accept socket calls
-
Hi Friends, My software server listens on a particular port using dedicated "listener thread" . We accept the connections from client and serve this request on different threads. Under high input requests from client (12000 approx/sec), the "listener thread" dies. Any suggestion for this kind of problem? Currently it looks to me that the select or accept call is possibly the reason behind. Should we use pselect or simialr to this? ~ Vikram S
-
Hi Friends, My software server listens on a particular port using dedicated "listener thread" . We accept the connections from client and serve this request on different threads. Under high input requests from client (12000 approx/sec), the "listener thread" dies. Any suggestion for this kind of problem? Currently it looks to me that the select or accept call is possibly the reason behind. Should we use pselect or simialr to this? ~ Vikram S
vikrams wrote:
the "listener thread" dies.
Please clarify "dies." Is there an error?
The difficult we do right away... ...the impossible takes slightly longer.
-
Hi Friends, My software server listens on a particular port using dedicated "listener thread" . We accept the connections from client and serve this request on different threads. Under high input requests from client (12000 approx/sec), the "listener thread" dies. Any suggestion for this kind of problem? Currently it looks to me that the select or accept call is possibly the reason behind. Should we use pselect or simialr to this? ~ Vikram S
Well, the first place I would look for is running out of memory. Depending on how you create the thread (_beginthreadex / CWinThread class / whatever) if you are creating a thread for each of the 12000/second arrivals, you might run out of some resource. You might check for stack size too, if I remember correctly, each thread gets a stack and that's taken off the end of your stack so, eventually, there'll be some overlap. I'm a bit foggy on that but it caused me problems in the past and I had to build the app with a larger stack size.