Learn how to use SignalR to build a chatroom application
The Introduction of SignalR
SignalR is a real-time communication method from ASP .NET. It connects the server side and the client side with the persistent connection. The transportation type of the connection could be to webSockets, foreverFrame, server-sent events, and longPolling.
The regard of the architecture of SignalR, The client can send messages to the hub. The hub can send messages to the specific client, groups of clients, or all clients as well.
It is readily apparent that developers can use the technique to build applications like the following chatroom.
The article introduces you how to create it. It has the following sections.
- The preparation
- The hub (the server side)
- The example code for the Hub
- The client
- The example code for the client