Home > other >  Consult, Linux Socket select and accpet asynchronous thread pool is always receive many empty reques
Consult, Linux Socket select and accpet asynchronous thread pool is always receive many empty reques

Time:10-14

A recent survey by the socket using the select error problem,
The program is very complex
Webserver thread, create port, binding in the callback recv
NetFrameWork thread, the main thread to monitor and select the data after
After using asynchronous threading the accept, accept to the message, to create a socket is added to the list,
The main thread through the linked list to monitor new FD,
Now program appear problem, a free socket can normal processing,
But when busy to equipment, select a lot of messages, all throw to asynchronous thread pool,
Asynchronous thread pool without processing, at the very beginning of a period of time to accept, create FD,
And create FD will listen to a lot of empty request,
Is excuse me this kind of mechanism is not suitable for the equipment performance is poor or busy?
Asynchronous thread of empty request, need treatment for a long time not to come over, but enough time, such as web or successfully shows,