.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上使用,如:

 
下面 来自  .Net 4.5 WebSocket Server Running on Windows 7?的相关讨论,

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
2 Answers
 
 

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.

  
answered
  • 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
  • 2
    Both 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
  • 4
    Yeah, 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上的比较的更多相关文章

  1. 解决 VirtualBox 安装windows 8.1 Preview OR Server 2012 R2 Preview 错误

    安装windows 8.1 Preview 或 Server 2012 R2 Preview时提示错误 Your PC needs to restart 解决方法: 在cmd中输入以下代码执行即可: ...

  2. EasyNVR H5无插件RTSP直播方案在Windows server 2012上修复无法定位GetNumaNodeProcessorMaskEx的问题

    今天遇到一个客户在使用EasyNVR无插件安防直播解决方案的时候,在Windows Server 2012上出现一个问题提示: 经过反复的查找,虽然提示上显示问题出在KERNEL32.dll上,但是已 ...

  3. 在Windows Server 2012上安装SharePoint 2010 SP1

    现在很多企业的系统都开始用上了Windows 2012,最近公司需要建立一个门户系统,一开始就想到了微软的SharePoint2010,这玩意确实非常强悍,2008已经褪去,当然直接在Windows ...

  4. 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.“一个文件正在被访问,当前 ...

  5. Windows Server 2012上PHP运行环境搭建的简易教程(Win08适用)

    微软的Windows Server 2012发布后,第一时间进行了简单的试用,非常不错,特写了个简易的PHP环境搭建教程.先来欣赏下Win2012的登录界面吧第一步我们需要安装IIS81.点击任务栏最 ...

  6. [转]在 Windows Server 2012 上安装 IIS 8

    本文转自:http://www.starland.net.cn/blog/view/158/1.aspx 本文译自:http://learn.iis.net/page.aspx/1088/instal ...

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

  8. 在Windows Server 2012 上安装Exchange 2013 服务器

    前文:http://www.cnblogs.com/Liangw/archive/2011/09/19/2559944.html 安装准备: 1.加入一个存在的域(?如何建立一个域) 2.登录Wind ...

  9. Windows Server 2012 上安装 dotNET Framework v3.5

    Windows Server 2012不能直接运行dotNET Framework v3.5安装程序进行安装,系统提供通过服务器管理器的添加功能和角色向导进行安装. 安装的前几个步骤再这里略去,在默认 ...

随机推荐

  1. 二十八、Linux 进程与信号---前台进程组

    28.1 介绍 28.1.1 概念 自动接受终端信号的组称为前台进程组 在终端通过 ctrl + c 等动作产生的信号首先被前台进程组接受 在 shell 启动的若干个进程组默认是父进程所在的组为前台 ...

  2. php时间转换

    UNIX时间戳和格式化日期是我们常打交道的两个时间表示形式,Unix时间戳存储.处理方便,但是不直观,格式化日期直观,但是处理起来不如Unix时间戳那么自如,所以有的时候需要互相转换,下面给出互相转换 ...

  3. faster rcnn 做识别

    faster rcnn 主要分为四个部分: 1. convolutional part: 特征提取 可以使用vgg,resnet 等等 2.region proposal network: 生成 re ...

  4. PHP中的会话控制—session和cookie(实现数据传值功能)

    1.session  登录上一个页面以后,长时间没有操作,刷新页面以后需要重新登录. 特点:(1)session是存储在服务器:   (2)session每个人(登陆者)存一份: (3)session ...

  5. QWidget-控件层级关系

    lower()     将控件降低到最底层 raise_()     将控件提升到最上层 label.raise_() a.stackUnder(b)    让a放在b下面 注意:以上操作专指同级控件 ...

  6. pycharm活动模板

    1.复制模板内容 2.文件设置: 点击+号:

  7. Coursera Deep Learning 2 Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization - week1, Assignment(Regularization)

    声明:所有内容来自coursera,作为个人学习笔记记录在这里. Regularization Welcome to the second assignment of this week. Deep ...

  8. python 的基础 学习 第四天 基础数据类型

    1,数字 int 数字主要是用于计算,使用方法并不是很多,就记住一种就可以. #bit_length() 当十进制用二进制表示时,转化为最少二进制的最少位数v = 11data = v.bit_len ...

  9. NPOI2.2.0.0实例详解(九)—设置EXCEL单元格【时间格式】

    原文:http://blog.csdn.net/xxs77ch/article/details/50245391 using System; using System.Collections.Gene ...

  10. BigDecimal实现末尾去掉无用0

    BigDecimal 原生提供了 stripTrailingZeros 方法可以实现去掉末尾的 0,然后使用 toPlainString 可以输出数值,注意这里如果使用 toString()  会变成 ...