在 Windows 7 上使用 WebSocket [英] Using WebSocket on Windows 7
问题描述
我刚刚安装了 Visual Studio 2012 RC 并尝试使用启用 WebSocket 的 netHttpBinding 运行服务并收到以下错误:
I just installed Visual Studio 2012 RC and tried to run a service with netHttpBinding enabling WebSocket and get the following error:
此平台不支持服务器端 WebSockets.
This platform does not support server side WebSockets.
The sample I am running is from http://blogs.microsoft.co.il/blogs/idof/archive/2012/03/01/what-s-new-in-wcf-4-5-websocket-support-part-1-of-2.aspx
WebSockets 能否在带有 Visual Studio 2012 RC 的 Windows 7 上运行?
Can WebSockets work on Windows 7 with Visual Studio 2012 RC?
推荐答案
不,无论您使用的是哪个 Visual Studio 版本,websockets 仅在 Windows 8 中被 Windows 本机支持.
No, websockets is only natively supported by Windows in Windows 8, regardless of which visual studio version you are using.
http://www.paulbatum.com/2011/09/getting-started-with-websockets-in.html
这是由于 Windows 7 中使用 http.sys 的一些低级问题造成的.
This is due to some low level issues in Windows 7 with http.sys.
它有可能被反向移植,但似乎不太可能:http://weblogs.asp.net/owscott/archive/2012/03/01/what-s-new-in-iis-8.aspx
There's an offchance it may be backported, but seems unlikely: http://weblogs.asp.net/owscott/archive/2012/03/01/what-s-new-in-iis-8.aspx
要在 Windows 7 上使用 websockets,您必须编写自己的服务.
To use websockets on Windows 7, you'll have to write your own service.
尝试将其用于客户端:http://websocket4net.codeplex.com/
服务器端:http://superwebsocket.codeplex.com/
这篇关于在 Windows 7 上使用 WebSocket的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!