Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between SignalR protocol version 1.2 and 1.3?

Tags:

signalr

What's the difference between version 1.2 and 1.3 of the SignalR protocol? I've checked the release notes and the github repo but can't figure out what is changed.

like image 267
Erik Z Avatar asked Oct 19 '13 12:10

Erik Z


People also ask

Which package is used for SignalR?

SignalR. Client NuGet package contains the . NET client libraries for ASP.NET Core SignalR. Use the HubConnectionBuilder to create and build an instance of a connection to a hub.

What is SignalR connection?

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.


2 Answers

The big change is when clients decide they are "connected". In the 1.3 protocol, an initialization message is sent back to the client and only then do clients consider themselves connected. Relevant code:

https://github.com/SignalR/SignalR/blob/dev/src/Microsoft.AspNet.SignalR.Client/Transports/TransportHelper.cs#L244

like image 96
davidfowl Avatar answered Sep 28 '22 15:09

davidfowl


This may be an incomplete list of changes I noticed when the client uses longPolling:

On the negotiate GET request, the client protocol and connection data are added as GET params to the URL:

  • 1.2 was simply ~/signalr/negotiate
  • 1.3 is ~/signalr/negotiate?clientProtocol=1.3&connectionData=[names of hubs]

In the negotiate JSON repsonse, the clientProtocol is now 1.3 instead of 1.2.

On the send POST request for longPolling, the connectionData (names of hubs) is added to the URL.

On longPoll responses from the server, as dfowler mentions, an "S" was added that initializes the connection.

like image 36
Chad Avatar answered Sep 28 '22 15:09

Chad