.NET 4.5的WebSocket服务器运行在Windows 7? [英] .Net 4.5 WebSocket Server Running on Windows 7?

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

问题描述

我知道是不支持Windows 7的ClientWebSocket类的.Net 4.5,但有可能建立在Windows 7上运行的WebSocket的服务器使用.net 4.5 API?

I know the ClientWebSocket class of .Net 4.5 is not supported on Windows 7, but is it possible to create a WebSocket server running on Windows 7 using the .Net 4.5 API?

为让自己更清楚,根据这里既和的here ,它看起来像的.Net 4.5的WebSocket实现服务器端部分应甚至支持Windows 7中,但运行的HttpListener和尝试使用一个开源的WebSocket实现访问它让我一个不支持Portocol错误

To make myself clearer, according to both here and here, it looks like the server side part of the .Net 4.5 WebSocket implementation should be supported even on Windows 7, yet running a HttpListener and trying to access it using an open-source WebSocket implementation got me a "Portocol not supported" error

推荐答案

操作系统级别的HTTP.SYS的WebSockets的支持仅限于Win8的/ Windows Server 2012中 - 这我同意是愚蠢的(应该是Windows的一部分更新或服务包顶多IMO)。

The OS-level HTTP.SYS support for websockets is limited to Win8 / Windows Server 2012 - which I agree is silly (it should be part of a windows-update, or a service-pack at most, IMO).

这意味着你不能使用的WebSockets框架支持的HttpListener 或ASP.NET直接。

This means that you can't use the framework support for WebSockets from HttpListener or ASP.NET directly.

不过:对于是否有可能建立一个WebSocket的服务器 - 肯定......但只有当你处理TCP / IP通讯科自己,或者使用第三方库一样。这是一个的的烦人,但不是那么糟糕,因为它听起来。

But: as for "is it possible to create a WebSocket server" - sure... but only if you handle the TCP/IP comms yourself, or use a 3rd-party library for the same. This is a little annoying, but is not as bad as it might sound.

编辑:一些检查后,我可以证实,在服务器端组件这个不要工作在Windows 7(等);在 IsWebSocketRequest 返回 尽管这是一个网络接口的请求连接:升级升级:WebSocket的(等)头(从浏览器会话,因为它可以帮助)

after some checking, I can confirm that the server-side components for this do not work on Windows 7 (etc); the IsWebSocketRequest returns false even though it is a web-socket request with Connection: Upgrade and Upgrade: websocket (etc) headers (from a Chrome session, as it helps).

我,不过,很惊讶以发现客户端片不工作,因为:这是简单,没有(或至少,没有的需要的)涉及HTTP.SYS。试图用他们抛出一个 PlatformNotSupportedException

I am, however, very surprised to find that the client-side pieces don't work, because: that is simpler and doesn't (or at least, doesn't need to) involve HTTP.SYS. Trying to use them throws a PlatformNotSupportedException.

这篇关于.NET 4.5的WebSocket服务器运行在Windows 7?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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