SignalR 101

14
Patrick Oliveros Microsoft MVP ASP.NET/IIS SIGNALR 101 MICROSOFT DEVELOPER PHILIPPINES TECHNICAL SHARING

description

This topic covers SignalR on a general level. The demo used for this talk was a modification of the default chat application to make it more descriptive and realistic in enterprise setting.

Transcript of SignalR 101

Page 1: SignalR 101

Patrick Oliveros

Microsoft MVP ASP.NET/IIS

SIGNALR 101

MICROSOFT DEVELOPER PHILIPPINES TECHNICAL SHARING

Page 2: SignalR 101

The web evolvedEvent-based, real-time UI

Partial page updates (Ajax), RIA

Dynamic pages, forms

Static HTML pages

Page 3: SignalR 101

Scenarios

Page 4: SignalR 101

ImplementationsPeriodic Pooling

Long Polling

Server-Sent Events

Web Sockets

Page 5: SignalR 101

Periodic Pooling

Polling interval

Cons:

• Poll from time to time using Ajax• Delay in communications due to polling interval• Wastes bandwidth & latency

Page 6: SignalR 101

Long Pooling

Cons:

• Poll but don’t respond untill there’s data• Poll again after data received or after the connection times out• Consumes server threads & connection resources

Page 7: SignalR 101

Web Sockets (HTML 5)• Extension to HTTP• Provide raw sockets over HTTP• Full-duplex• Traverses proxies

• It’s still a draft…• Not every proxy server supports it • Not every webserver supports it • Not every browser supports it • They are raw sockets!

Page 8: SignalR 101

So What Now?Superman SignalR to the rescue!

Page 9: SignalR 101

Enter SignalR

• ASP.NET SignalR is a new library for ASP.NET developer that makes it incredibly simple to add real-time web functionality to your applications

• Async signaling library for .NET to help build real-time, multi-user interactive web applications ( aka persistent connection abstraction for .NET);

Page 10: SignalR 101

Enter SignalR

Page 11: SignalR 101

Transport PriorityWeb Sockets

Server-Sent Events

Forever Frame

Long Polling

Page 12: SignalR 101

Demo

Page 13: SignalR 101

Resources• SignalR project page:

http://www.signalr.net

• SignalR on github:

https://github.com/SignalR/SignalR

Page 14: SignalR 101

Thanks!