As you can see, this is my first blog posted in cnblog. If you find any mistake, don’t hesitate to tell me, I will buy you ice cream.

Today I want to talk about SignalR, a .Net real time library provided by Asp.Net team, which is such an old concept that it has been around for over 10 years. But real time technology is relatively recently that we’ve started seeing them used (or advertised). I think it’s mainly because this tech has matured and become standardised.

Warm up

If this is the first time you heard of SignalR, you may want to get started with some tutorials about adding real-time functionality to a web/desktop application. It’s a good habit to code yourself while learning new things.

Architecture

After going through the samples, you can know how this is implemented, the architecture is really simple. All connections between clients and server side are full duplex. Clients can send messages to the server as they always do, server can also push notifications to a specific client. But clients won’t talk to each other. From this point of view, you may find the server code is more or less a router.

The only question left for us is , what kind of message should we send?

“There is one thousand Hamlet in one thousand reader’s eyes”. If you are building a online chat room like Jabbr, you’d like to send/receive encrypted texts and images. If you are developing an online game, the messages would be more complex. Anyway, it just depends on your needs.

Platform and Protocol

SignalR is supported under a variety of server and client configurations. Meanwhile, each transport option has a set of requirement of its own. Like WebSocket, SignalR supports this new technique, but it falls back to other compatible techniques for older browsers or clients gracefully.

In server side, If you want to use WebSocket, Windows Server 2012 or Windows 8 is required. WebSocket can even be used on Windows Azure websites, as long as the site’s .NET framework version is set to 4.5 and WebSocket option is enabled.

While in Client side, the situation may be more complex. It varies from Web Browser, Windows desktop applications, Silverlight application to mobile devices. Just as you can see below, SignalR may use Forever Frame, Server-Sent Events or Long Polling if WS is somehow not supported.

However, as a .NET developer, you will never be bothered which protocol to choose. You can even regard SignalR as a wrapper and do not care about the inner implementation. SignalR would decide which protocol is the best and switch to it.

As SignalR supports multi platforms, it is such a relief to .NET developers that we don’t need to learn more libraries doing the same thing. A stable and easy-to-use library is enough. I even leverage SignalR in my personal Chrome Extension then I have a perfect real time logging module.

For more information

You can read its documentation for more details. As SignalR is open-source, you can follow its repo in github then read its source code directly. BTW, I have to say .NET is really powerful and I’m just a newbie to this fresh new world.

SignalR: The new old thing的更多相关文章

  1. SignalR系列续集[系列8:SignalR的性能监测与服务器的负载测试]

    目录 SignalR系列目录 前言 也是好久没写博客了,近期确实很忙,嗯..几个项目..头要炸..今天忙里偷闲.继续我们的小系列.. 先谢谢大家的支持.. 我们来聊聊SignalR的性能监测与服务器的 ...

  2. ABP文档 - SignalR 集成

    文档目录 本节内容: 简介 安装 服务端 客户端 连接确立 内置功能 通知 在线客户端 帕斯卡 vs 骆峰式 你的SignalR代码 简介 使用Abp.Web.SignalR nuget包,使基于应用 ...

  3. SignalR快速入门 ~ 仿QQ即时聊天,消息推送,单聊,群聊,多群公聊(基础=》提升)

     SignalR快速入门 ~ 仿QQ即时聊天,消息推送,单聊,群聊,多群公聊(基础=>提升,5个Demo贯彻全篇,感兴趣的玩才是真的学) 官方demo:http://www.asp.net/si ...

  4. SignalR代理对象异常:Uncaught TypeError: Cannot read property 'client' of undefined 推出的结论

    异常汇总:http://www.cnblogs.com/dunitian/p/4523006.html#signalR 后台创建了一个DntHub的集线器 前台在调用的时候出现了问题(经检查是代理对象 ...

  5. 基于SignalR实现B/S系统对windows服务运行状态的监测

    通常来讲一个BS项目肯定不止单独的一个BS应用,可能涉及到很多后台服务来支持BS的运行,特别是针对耗时较长的某些任务来说,Windows服务肯定是必不可少的,我们还需要利用B/S与windows服务进 ...

  6. SignalR SelfHost实时消息,集成到web中,实现服务器消息推送

    先前用过两次SignalR,但是中途有段时间没弄了,今天重新弄,发现已经忘得差不多了,做个笔记! 首先创建一个控制台项目Nuget添加引用联机搜索:Microsoft.AspNet.SignalR.S ...

  7. SignalR系列目录

    [置顶]用SignalR 2.0开发客服系统[系列1:实现群发通讯] [置顶]用SignalR 2.0开发客服系统[系列2:实现聊天室] [置顶]用SignalR 2.0开发客服系统[系列3:实现点对 ...

  8. 基于SignalR的消息推送与二维码描登录实现

    1 概要说明 使用微信扫描登录相信大家都不会陌生吧,二维码与手机结合产生了不同应用场景,基于二维码的应用更是比较广泛.为了满足ios.android客户端与web短信平台的结合,特开发了基于Singl ...

  9. XAMARIN.ANDROID SIGNALR 实时消息接收发送示例

    SignalR 是一个开发实时 Web 应用的 .NET 类库,使用 SignalR 可以很容易的构建基于 ASP.NET 的实时 Web 应用.SignalR 支持多种服务器和客户端,可以 Host ...

  10. ABP源码分析三十二:ABP.SignalR

    Realtime Realtime是ABP底层模块提供的功能,用于管理在线用户.它是使用SignalR实现给在线用户发送通知的功能的前提 IOnlineClient/OnlineClient: 封装在 ...

随机推荐

  1. 打印grid

    void PrintButtonClick(object sender, EventArgs e) { PrintPreviewDialog dlg = new PrintPreviewDialog( ...

  2. 文件写操作--WriteLog

    private static void Write(string sMsg, string fileName) { if (sMsg != "") { try { var dir ...

  3. CodeForcesGym 100753B Bounty Hunter II 二分图最小路径覆盖

    关键在建图 题解:http://www.cnblogs.com/crackpotisback/p/4856159.html 学习:http://www.cnblogs.com/jackiesteed/ ...

  4. oracle中查看某个用户名下所有的表以及sequence

    select   table_name   from   all_tables   where   owner   =upper('jdfp')    ; 此处查的是tieba这个用户表空间下的所有表 ...

  5. JZ2440开发笔记(9)——位置无关代码设计【转】

    b MAIN 和 ldr pc,=MAIN 的区别(谈到代码位置无关性) 看bootloader的时候经常看到这两种写法,不太明白区别,网上查了查.其实看了之后还是一头雾水? 其中,2和3 似乎是一个 ...

  6. 拉普拉斯特征图降维及其python实现

    这种方法假设样本点在光滑的流形上,这一方法的计算数据的低维表达,局部近邻信息被最优的保存.以这种方式,可以得到一个能反映流形的几何结构的解. 步骤一:构建一个图G=(V,E),其中V={vi,i=1, ...

  7. grep环境变量常用配置

    vim ~/.bashrc GREP_OPTIONS="-irns --exclude-dir=output --exclude=tags --exclude=*.files" 然 ...

  8. c++学习_1

    最近重新捧起了<Effective c++>,其中味道又有不同,这里记录之... 这篇文章记录一下public继承的知识点... (1)public继承的意义 该继承方式是代表is-a(是 ...

  9. ACM编程技巧--常用字符操作函数

    字符串与基本数据类型的转换 int sscanf(buff,"%d%d",&a,&b); //返回值是参数个数 int sprintf(buff,"%d% ...

  10. Spring笔记(三)AOP前篇之动态代理

    AOP思想是将程序中的业务代码与服务代码进行分离,在运行时进行结合.比较强调程序的层次结构,是一种面向切面的编程.而在AOP实现的底层主要用到了动态代理,而动态代理又分为JDK动态代理和CGLIB动态 ...