Net 4.5 WebSocket 在 Windows 7, Windows 8 and Server 2012上的比较
.Net 4.5 WebSocket Server Running on Windows 7?
Net 4.5 WebSocket Server 可以运行在 Windows 7,但是Net 4.5的 ClientWebSocket 不支持 Windows 7,只支持 Windows 8 and Server 2012,但是可以使用第三方类库来支持Net 4.5 WebSocket 在win7,Windows 7上使用,如:
- https://github.com/statianzo/Fleck
- http://vtortola.github.io/WebSocketListener/
- http://superwebsocket.codeplex.com/
- https://archive.codeplex.com/?p=websocket4net
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?
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
- While it is an interesting question, it doesn't show much effort. What have you tried? According to MSDN indeed only Windows 8 and Server 2012 are supported. Do you require .NET built-in support? Otherwise there are various third-party libraries that suit your requirements. – CodeCaster Aug 22 '12 at 12:54
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).
This means that you can't use the framework support for WebSockets from HttpListener
or ASP.NET directly.
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.
Edit: 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).
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
.
- 1@sternr I don't think they are; I think it'll error at runtime. What is even more interesting: I was under the impression that
ClientWebSocket
was supported on Win7 etc, since it doesn't depend on HTTP.SYS! – Marc Gravell♦ Aug 22 '12 at 13:18 - 1@sternr did some more research / testing on that; answer stands. – Marc Gravell♦ Aug 22 '12 at 13:49
- 7@sternr it is bizarre from my point of view too. I'm very disappointed by this, especially the client-side pieces. Meh, no actually I'm disappointed by the server-side pieces too. – Marc Gravell♦ Aug 22 '12 at 13:52
- 2Both the client-side and the server-side pieces depend on an OS-level component (websocket.dll), and this component only ships with Windows 8 / Server 2012. I am unsure of why this component cannot run downlevel, but the dependency explains the behavior you are seeing. – Levi Aug 24 '12 at 6:13
- 4Yeah, honestly, who thinks this is really a technical issue. – Craig Dec 3 '13 at 1:58
As Marc says, the Microsoft APIs do not work on Windows 7. However there are several open source libraries that support WebSockets on Windows 7, and in some cases even cross platform via Mono.
Net 4.5 WebSocket 在 Windows 7, Windows 8 and Server 2012上的比较的更多相关文章
- 解决 VirtualBox 安装windows 8.1 Preview OR Server 2012 R2 Preview 错误
安装windows 8.1 Preview 或 Server 2012 R2 Preview时提示错误 Your PC needs to restart 解决方法: 在cmd中输入以下代码执行即可: ...
- EasyNVR H5无插件RTSP直播方案在Windows server 2012上修复无法定位GetNumaNodeProcessorMaskEx的问题
今天遇到一个客户在使用EasyNVR无插件安防直播解决方案的时候,在Windows Server 2012上出现一个问题提示: 经过反复的查找,虽然提示上显示问题出在KERNEL32.dll上,但是已 ...
- 在Windows Server 2012上安装SharePoint 2010 SP1
现在很多企业的系统都开始用上了Windows 2012,最近公司需要建立一个门户系统,一开始就想到了微软的SharePoint2010,这玩意确实非常强悍,2008已经褪去,当然直接在Windows ...
- Net 4.5 WebSocket 在 Windows 7, Windows 8 and Server 2012上的比较以及问题
Net 4.5 WebSocket在Windows 8, Windows 10, Windows Server 2012可以,但是在Windows 7, 就会报错. 错误1.“一个文件正在被访问,当前 ...
- Windows Server 2012上PHP运行环境搭建的简易教程(Win08适用)
微软的Windows Server 2012发布后,第一时间进行了简单的试用,非常不错,特写了个简易的PHP环境搭建教程.先来欣赏下Win2012的登录界面吧第一步我们需要安装IIS81.点击任务栏最 ...
- [转]在 Windows Server 2012 上安装 IIS 8
本文转自:http://www.starland.net.cn/blog/view/158/1.aspx 本文译自:http://learn.iis.net/page.aspx/1088/instal ...
- [Windows Server] 在 Windows Server 2012 上安裝 .NET Framework 3.5 - 摘自网络
官方: Applies To: Windows 8, Windows 8.1 For a Windows Server® 2012 core installation that is not conn ...
- 在Windows Server 2012 上安装Exchange 2013 服务器
前文:http://www.cnblogs.com/Liangw/archive/2011/09/19/2559944.html 安装准备: 1.加入一个存在的域(?如何建立一个域) 2.登录Wind ...
- Windows Server 2012 上安装 dotNET Framework v3.5
Windows Server 2012不能直接运行dotNET Framework v3.5安装程序进行安装,系统提供通过服务器管理器的添加功能和角色向导进行安装. 安装的前几个步骤再这里略去,在默认 ...
随机推荐
- luogu 3538/bzoj 2795 Poi2008 哈希+质数结论
题意:给定一个子串,询问一些子区间内的最短循环节(循环节是越短条件约束越多) 开始一看那就哈希处理然后暴力枚举循环节,然后按照循环节长度暴力向后比较,本地测试40,洛谷60 #include<b ...
- solr window环境安装配置和管理页面基本使用
solr介绍 来自官网http://lucene.apache.org/solr/解释: Solr is highly reliable, scalable and fault tolerant, p ...
- CF961G Partitions
传送门 luogu 显然每个数的贡献可以一起算感性理解一下,于是答案就是权值总和乘以每个数被算了几次 那个"集合大小为\(|S|\)的集合权值为权值和乘\(|S|\)",可以看成一 ...
- 快速做ssh免密钥登陆
1.本地生成密钥并发送目标主机 >&1 #采用数字签名RSA或DSA生成密钥文件和私钥文件 id_rsa,id_rsa.pub或id_dsa,id_dsa.pub ssh-copy-id ...
- Django学习手册 - 权限管理(一)
权限管理原理: 不同角色拥有不同的角色权限,所以能否访问的页面也就不相同. 通过控制URL使用户访问到不同的URL,从而达到权限控制的目的. 设计权限数据库 权限管理 from django.db i ...
- Object的wait/notify/notifyAll&&Thread的sleep/yield/join/holdsLock
一.wait/notify/notifyAll都是Object类的实例方法 1.wait方法:阻塞当前线程等待notify/notifyAll方法的唤醒,或等待超时后自动唤醒. wait等待其实是对象 ...
- ASP.NET - 学习总目录
ASP.NET - 处理页面 ASP.NET - ADO.NET框架 ASP.NET - 创建功能菜单 ASP.NET MVC - 入门 ASP.NET MVC - 模型验证 ASP.NET MVC ...
- Windows10安装Ubuntu子系统设置Python3测试环境
参考链接:https://blog.csdn.net/shanelee73/article/details/80238876
- 【VMware vSphere】vCenter添加主机失败:无法访问指定主机
背景 前一段时间,给一台服务器安装ESXi系统,安装成功之后,通过vCenter在上面安装了一台VDP系统.结果前几天发现服务器掉线,重新连接时出现问题.问题描述如下: 其中错误堆栈具体内容为:在 v ...
- node promise库bluebird
var fs = require('fs') var Promise = require("bluebird") function file1() { return new Pro ...