.NET 4.5 服务器端 WebSocket 是否使用 IOCP? [英] Do .NET 4.5 Server-Side WebSockets use IOCP?

查看:31
本文介绍了.NET 4.5 服务器端 WebSocket 是否使用 IOCP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Does anyone know if AspNetWebSocket (introduced in .NET Framework 4.5) utilizes IOCP for handling requests instead of one thread per Connection?

推荐答案

有一种相对简单的方法可以让您自己解决这个问题.

There's a relatively easy way for you to work this out for yourself.

  • 创建一个简单的程序.
  • 使用任务监视器观察它并查看线程数.
  • 创建大量的网络套接字连接到它.
  • 查看线程数是否在连接处于活动状态时增加.
  • 比较连接数和线程数.

但是,这又有什么关系呢?只要 API 满足您的性能和可扩展性要求,您只能通过对应用程序进行性能测试来发现这些要求.

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.

请注意,如果实现不使用 IOCP,我会非常惊讶,但询问恕我直言真的没什么意义.

Note that I would be VERY surprised if the implementation does NOT use IOCP but there's really little point in asking IMHO.

这篇关于.NET 4.5 服务器端 WebSocket 是否使用 IOCP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆