library for ASP.
NET developers that simplifies the process of adding real-time web functionality to
applications. Real-time web functionality is the ability to have server code push content to connected clients
instantly as it becomes available, rather than having the server wait for a client to request new data.
Examples include dashboards and monitoring applications, collaborative applications (such as simultaneous
editing of documents), job progress updates, and real-time forms.
SignalR provides a simple API for creating server-to-client remote procedure calls (RPC) that call JavaScript
functions in client browsers (and other client platforms) from server-side .NET code. SignalR also includes
API for connection management (for instance, connect and disconnect events), and grouping connections.
SignalR handles connection management automatically, and lets you broadcast messages to all connected
clients simultaneously, like a chat room. You can also send messages to specific clients. The connection
between the client and server is persistent, unlike a classic HTTP connection, which is re-established for each
communication.
Example
Package Manager Console
You can also add SignalR to a project by opening the Tools | Library Package Manager | Package Manager Console and
running a command: install-package Microsoft.AspNet.SignalR
using System;
using System.Web;
using Microsoft.AspNet.SignalR;
namespace SignalRChat
{
public class ChatHub : Hub
{
public void Send(string name, string message)
{
// Call the broadcastMessage method to update clients.
Clients.All.broadcastMessage(name, message);
}
}
}