问题
Does anyone know if AspNetWebSocket (introduced in .NET Framework 4.5) utilizes IOCP for handling requests instead of one thread per Connection?
回答1:
There's a relatively easy way for you to work this out for yourself.
- Create a simple program.
- Watch it with a task monitor and look at the number of threads.
- Create lots of web socket connections to it.
- See if the thread count increases whilst the connections are alive.
- Compare the number of connections to the number of threads.
But, what does it matter? As long as the API meets your performance and scalability requirements which you will only discover from performance testing your application.
Note that I would be VERY surprised if the implementation does NOT use IOCP but there's really little point in asking IMHO.
来源:https://stackoverflow.com/questions/16105821/do-net-4-5-server-side-websockets-use-iocp