.NET 4.5的WebSockets VS SignalR [英] .NET 4.5 WebSockets vs SignalR

查看:475
本文介绍了.NET 4.5的WebSockets VS SignalR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过的<一个href=\"http://stackoverflow.com/questions/9307675/signalr-vs-html5-websockets-for-asp-net-mvc-chat-application\">signalR VS HTML5的WebSockets的asp.net MVC聊天应用,但因为它是根据各地的WebSockets HTML5,微软可能对在.NET 4.5与他们的WebSocket对象扩展它没有100%的回答我的问题。

我想知道如果WebSocket的功能不实际做一样SignalR并回落到长轮询的WebSockets时不可用?当然,微软将实施相同的技术SignalR在他们的做法将这一技术?

编辑:

有关谁都知道这一点,我发现这个评论最有用的了解情况,为什么我会使用SignalR:


  

那么,他们都算不上。直到现在IIS和AS​​P.NET没有
  建在什么支持的WebSockets因此SignalR项目不得不
  建立它自己。现在,微软正在提供管道
  SignalR可以方便地切换到使用微软的实施,
  无论是在除或向而不是他们自己。 SignalR是一个
  抽象了实施细则,WebScockets类是
  实现细节



解决方案


  1.   

    我想知道如果WebSocket的功能不实际做一样SignalR并回落到长轮询的WebSockets时不可用?


    的WebSockets是一个新的协议独立于其他通信技术。从RFC


      

    此技术的目标是提供一种机制,基于浏览器的
      需要与服务器的双向通信应用的,做
      不依赖于打开多个HTTP连接
    如,使用
      XMLHtt prequest或s和长轮询)。




  2.   

    当然,微软将实现相同的技术SignalR在他们的做法将这一技术?


    如果他们要符合规范,他们不会。当然没有什么事,从开发类似SignalR,将抽象掉沟通细节,并提供优美的后备更高级别的API停止微软。但是,这种假设的API可能会建立在<顶部href=\"http://msdn.microsoft.com/en-us/library/system.net.websockets.websocket%28v=vs.110%29.aspx\">WebSocket而不是取代它的类。


I've seen signalR vs html5 websockets for asp.net MVC chat application but it doesn't 100% answer my question as it's based around HTML5 WebSockets, which Microsoft may have extended upon in .NET 4.5 with their WebSocket object.

I'm wondering if the WebSocket feature does actually do the same as SignalR and fall back to long polling when WebSockets aren't available? Surely Microsoft would implement the same technology as SignalR in their approach to this technology?

Edit:

For anyone else wondering about this, I found this comment the most helpful to understand the scenario and why I'll be using SignalR:

Well, they are not really. Up until now IIS and ASP.NET didn't have anything built in that supported WebSockets so SignalR project had to build it themselves. Now that Microsoft is providing the plumbing SignalR could easily switch to using Microsoft's implementation, either in addition to or instead of their own. SignalR is an abstraction over implementation details, WebScockets class is the implementation detail

解决方案

  1. I'm wondering if the WebSocket feature does actually do the same as SignalR and fall back to long polling when WebSockets aren't available?

    WebSockets is a new protocol independent of other communication techniques. From the RFC

    The goal of this technology is to provide a mechanism for browser-based applications that need two-way communication with servers that does not rely on opening multiple HTTP connections (e.g., using XMLHttpRequest or s and long polling).

  2. Surely Microsoft would implement the same technology as SignalR in their approach to this technology?

    Not if they want to conform to the specification they won't. There's certainly nothing stopping Microsoft from developing a higher level API similar to SignalR that would abstract away communication detail and offer graceful fallback. However that hypothetical API would probably build on top of WebSocket class as opposed to replacing it.

这篇关于.NET 4.5的WebSockets VS SignalR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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