Using a queue with multiple threads to handle large numbers of client requests is similar to the asynchronous version of the socket functions which use a thread pool with a work item queue to handle each tasks.
How To Use?
using TcpServerSocket is very easy. you only need to do like this:
var tcp = new TcpServer
{
RecvNewClientAction = handler => Debug.WriteLine("recv new client: " + handler),
LostClientAction = handler => Debug.WriteLine("lost client :" + handler),
RecvDataAction = (ip, data, len) => Debug.WriteLine("{0}:{1}", ip, Encoding.ASCII.GetString(data, 0, len)),
ListenPort = 8080
};
tcp.StartListen();
Chinese blog for more information:
http://www.cnblogs.com/DotCpp/p/3885598.html