SignalR is a library for ASP.NET developers that simplifies adding real-time web functionality to applications. It allows for bi-directional communication between server and client using websockets or fallback technologies like long polling. SignalR makes it easy to broadcast messages from server to connected clients and vice versa. While it works out of the box for web and Windows apps, mobile clients require additional libraries for true push notifications. The presenter demonstrates a simple chat hub and encourages attendees to check online resources for more information on using SignalR.
1. SignalR
The fast and easy way to do push
messaging.
Bi directional communication made easy!
2. SinalR – Who is this guy?
Paul Whitmer
–
ASP.Net Developer at Bridgepoint Education
–
Twitter if you like the presentation: paulwhitmer
–
Email: paul.whitmer@gmail.com
3. SignalR – What is it?
It's a wrapper for WebSockets!
●
●
It optimizes bi directional communication, makes
implementation simpler between clients and servers.
It helps reduce overhead and increases scalability.
4. SignalR – Why would I use this?
●
Easy to configure
●
Once hand shake is completed it is no longer an HTTP request but
communications protocol
●
Supports bi-directional communication
●
Supports fallback technologies
●
Long-polling, SSE, and others
5. SignalR – What are the limitations?
It's a Mobile Web World!
iOS open source project: SignalR-ObjC
– Must install CocoaPods to install
– It's Ruby gems in an Objective C program to connect with ASP.Net
Android open source project: SignalA
– Uses long polling so no true push service
Windows 8 works out of the box
6. SignalR – What are the benefits?
Easy To Use!
Install
Install-Package Microsoft.AspNet.SignalR
Client Code
var connection = $.hubConnection();
proxy = connection.createHubProxy('learningHub');
proxy.on('broadcast', onNewMessage);
Server Code
[HubName("learningHub")]
public class LearningHub : Hub
{
public void SendMessage(string message, string user)
{
Clients.All.broadcast(message, user);
}
}
–
7. Demo Time!!!
●
Show how simple hub works to broadcast message
●
Show page design using javascript for connection to hub
●
Show front page of application side by side browsers