做.NET 4.5服务器端的WebSockets使用IOCP?(Do .NET 4.5 Server

2019-11-02 02:05发布

有谁知道,如果AspNetWebSocket(在.NET框架4.5中引入)利用IOCP处理请求,而不是每个连接一个线程?

Answer 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.



文章来源: Do .NET 4.5 Server-Side WebSockets use IOCP?