SignalR技术

 

  这个专题的技术,我是17年7月前后便已经接触过了的,受技术和时间上的原因,一直未能去梳理一下这个方面的内容。今天由于写技术报告,不得不花时间去整理了。

整体而言,SinglelR 是 ASP.NET 团队正在开发的一个 Microsoft .NET Framework 库和 jQuery 插件,可能包括在以后版本的 ASP.NET 平台中。 它提供了一些前景极为光明的功能,而这些功能正是 .NET Framework 当前不曾具有的,并且是越来越多的开发者所需要的。

SignalR 是一个集成的客户端与服务器库,基于浏览器的客户端和基于 ASP.NET 的服务器组件可以借助它来进行双向多步对话。 换句话说,该对话可不受限制地进行单个无状态请求/响应数据交换;它将继续,直到明确关闭。 对话通过永久连接进行,允许客户端向服务器发送多个消息,并允许服务器做出相应答复,值得注意的是,还允许服务器向客户端发送异步消息。是一个完全基于客户及服务器端解决方案,它是以JS作为客户端和ASP.NET作为服务端来创建这类的应用。

一、SignalR

  SingleR又称为ASP.NET SingleR。它是ASP.NET开发人员的一个新的工具类库,它能以不可思议的简洁方式,给你的应用程序添加实时的网络功能。什么是“实时网络”?指的就是能够使服务端的应用程序,在服务端事件发生时,就能将内容推送给连接到该网络服务上的客户端,而且是实时的。你可能会听说过WebSockets,它是一个新的HTML5 的API,能够在服务器和浏览器之间进行双向通信。

SignalR will use WebSockets under the covers when it's available, and gracefully fallback to other techniques and technologies when it isn't, while your application code stays the same.

SignalR also provides a very simple, high-level API for doing server to client RPC (call JavaScript functions in your clients' browsers from server-side .NET code) in your ASP.NET application, as well as adding useful hooks for connection management, e.g. connect/disconnect events, grouping connections, authorization.

二、 SignalR的应用场景

SignalR can be used to add any sort of "real-time" web functionality to your ASP.NET application. While chat is often used as an example, you can do a whole lot more. Any time a user refreshes a web page to see new data, or the page implements Ajax long polling to retrieve new data, is candidate for using SignalR.

It also enables completely new types of applications, that require high frequency updates from the server, e.g. real-time gaming.

扫描二维码关注公众号,回复: 5014128 查看本文章

参考文章

ASP.NET SignalR,Incredibly simple real-time web for .NET

SingleR, 世界终点;

.net MVC前后端通信—SingleR,文件监控FileSystemWatcher,SQ-lx.

WebSocket与消息推送,XiaoGuang-Xu.

NET利用SignalR实现选择性消息推送qq_18798917.

Asp.NET MVC 使用 SignalR 实现推送功能一(Hubs 在线聊天室), 瑞雪骄阳.

 

 

 

 

 

 

猜你喜欢

转载自www.cnblogs.com/arxive/p/10301353.html