[go: up one dir, main page]

0% found this document useful (0 votes)
251 views2 pages

Real-Time Web with SignalR

SignalR is a library for ASP.NET developers that simplifies adding real-time functionality to applications. It provides a simple API for creating server-to-client remote procedure calls that call JavaScript functions in client browsers from server-side .NET code. SignalR handles connection management and allows broadcasting messages simultaneously to all connected clients, such as in a chat room.

Uploaded by

tomas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
251 views2 pages

Real-Time Web with SignalR

SignalR is a library for ASP.NET developers that simplifies adding real-time functionality to applications. It provides a simple API for creating server-to-client remote procedure calls that call JavaScript functions in client browsers from server-side .NET code. SignalR handles connection management and allows broadcasting messages simultaneously to all connected clients, such as in a chat room.

Uploaded by

tomas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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);
}
}
}

You might also like