Overview:
Real-time applications are that applications that display data to the connected user as soon as it becomes available. Facebook and twitter and online multiple player games are the great examples of real-time applications.Introduction to SignalR:
Microsoft introduced SignalR Library for Asp.net developers to build Real-time applications. SignalR has an ability to push content from the server on all connected user intently and user won't need to refresh the page for updates. SignalR uses four different transport medium to simplify the process of real-time communication.- WebSocket.
- Server Sent Events
- Forever Frame
- Ajax Long Polling
SignalR consists of to different connection models that makes the client-server communication possible in two different ways.
- Persistence Connections.
- Hubs.
Persistence Connection.
Its a low-level connection allows more control over the connection, user can extend PersistenceConnection Class to perform more specific tasks.Hubs.
Hubs are the high-level connection over persistence connection, that are most preferable among users. it allow user to call service side methods from client side and vice-versa .SignalR Implementation.
Following are the steps to implement a simple notification system with SignalR in Visual Studio and C#.Building a simple Notification System.
In this demo, user will need to enter their PIN to login, once the user is logged in, Admin user will be notified and get this user in Active User list.Step # 1: Create Project.
Create a new C# Asp.net Web Form Application and give a name "SignalRNotificationDemo".