Determine the transport method in SignalR Core?


Dave New

In SignalR 2.0, the transport method can be determined by parameters in the query transportstring .

string transportMethod = queryString["transport"];

This doesn't seem to be the case with SignalR for ASP.NET Core.

It seems that the best I can do is use the header information.

For WebSocket connections:

Connection = Upgrade
Upgrade = Websocket

and long polling :

Connection = Keep-Alive

and server-sent events :

Connection = Keep-Alive
Accept = text/event-stream

Is there a better/easier way to determine the shipping method?

Mikael Mengistu

You can get the transport type from HubCallerContext like this

 Context.Items[ConnectionMetadataNames.Transport]

Related


Determine the transport method in SignalR Core?

Dave New In SignalR 2.0, the transport method can be determined by parameters in the query transportstring . string transportMethod = queryString["transport"]; This doesn't seem to be the case with SignalR for ASP.NET Core. It seems that the best I can do is

Determine the transport method in SignalR Core?

Dave New In SignalR 2.0, the transport method can be determined by parameters in the query transportstring . string transportMethod = queryString["transport"]; This doesn't seem to be the case with SignalR for ASP.NET Core. It seems that the best I can do is

Determine the transport method in SignalR Core?

Dave New In SignalR 2.0, the transport method can be determined by parameters in the query transportstring . string transportMethod = queryString["transport"]; This doesn't seem to be the case with SignalR for ASP.NET Core. It seems that the best I can do is

The signalR core defines the transport

sharp Before the final release of SignalR core. I am able to send the transport when defining a new HubConnection (JavaScript) var cnn = new signalR.HubConnection("/myhub", {transport : signalrR.TransportType.LongPolli

The signalR core defines the transport

sharp Before the final release of SignalR core. I am able to send the transport when defining a new HubConnection (JavaScript) var cnn = new signalR.HubConnection("/myhub", {transport : signalrR.TransportType.LongPolli

The signalR core defines the transport

sharp Before the final release of SignalR core. I am able to send the transport when defining a new HubConnection (JavaScript) var cnn = new signalR.HubConnection("/myhub", {transport : signalrR.TransportType.LongPolli

The signalR core defines the transport

sharp Before the final release of SignalR core. I am able to send the transport when defining a new HubConnection (JavaScript) var cnn = new signalR.HubConnection("/myhub", {transport : signalrR.TransportType.LongPolli

How to get AspNet Core SignalR transport protocol in hub?

Jesse Sierks In old SignalR you could do the following to get the transport in the hub on the server: Context.QueryString["transport"]; But in the new SignalR written for AspNet Core, I can't find where in the server's hub I can find the transport protocol. C

How to get AspNet Core SignalR transport protocol in hub?

Jesse Sierks In old SignalR you could do the following to get the transport in the hub on the server: Context.QueryString["transport"]; But in the new SignalR written for AspNet Core, I can't find where in the server's hub I can find the transport protocol. C

Call SignalR Core Hub method from Controller

Markla: How to call SignalR Core Hub methods from Controller? I'm using ASP.NET Core 2.0 with Microsoft.AspNetCore.SignalR (1.0.0-alpha2-final). I have windows services that communicate with Excel, SolidEdge and Excel... When done, it posts the request to a co

Call SignalR Core Hub method from Controller

Markla: How to call SignalR Core Hub methods from Controller? I'm using ASP.NET Core 2.0 with Microsoft.AspNetCore.SignalR (1.0.0-alpha2-final). I have windows services that communicate with Excel, SolidEdge and Excel... When done, it posts the request to a co

Call SignalR Core Hub method from Controller

Markla: How to call SignalR Core Hub methods from Controller? I'm using ASP.NET Core 2.0 with Microsoft.AspNetCore.SignalR (1.0.0-alpha2-final). I have windows services that communicate with Excel, SolidEdge and Excel... When done, it posts the request to a co

Send the session ID to the SignalR Core OnConnected method

Application Solutions I'm trying to send an ASP.NET Core 5 application's session ID to my SignalR Core Hub using Razor Pages. However, the session ID is only added to the negotiation request, not to the actual WebSocket being opened: How can I add it to the se

Calling Signalr method from Controller .Net Core 2.1

Brett Rigby I'm trying to call a method in the signalr Hub class from a (ASP.NET Core) MVC controller, but I can't find an example online that shows how. Note: There are plenty of examples using older versions of Signalr with .Net Framework, but I can't see an

Send message from controller method to Angular using SignalR Core

Deadpool I am trying to use SignalR with Asp Net Core 2.1 in order to send a message from a controller method which is triggered from a test button in Angular. The behavior I expect is that when I click the button, my service calls the controller method which

Send message from controller method to Angular using SignalR Core

Deadpool I am trying to use SignalR with Asp Net Core 2.1 in order to send a message from a controller method which is triggered from a test button in Angular. The behavior I expect is that when I click the button, my service calls the controller method which

Calling Signalr method from Controller .Net Core 2.1

Brett Rigby I'm trying to call a method in the signalr Hub class from a (ASP.NET Core) MVC controller, but I can't find an example online that shows how. Note: There are plenty of examples using older versions of Signalr with .Net Framework, but I can't see an

Calling Signalr method from Controller .Net Core 2.1

Brett Rigby I'm trying to call a method in the signalr Hub class from a (ASP.NET Core) MVC controller, but I can't find an example online that shows how. Note: There are plenty of examples using older versions of Signalr with .Net Framework, but I can't see an

Send message from controller method to Angular using SignalR Core

Deadpool I am trying to use SignalR with Asp Net Core 2.1 in order to send a message from a controller method which is triggered from a test button in Angular. The behavior I expect is that when I click the button, my service calls the controller method which

Calling Signalr method from Controller .Net Core 2.1

Brett Rigby I'm trying to call a method in the signalr Hub class from a (ASP.NET Core) MVC controller, but I can't find an example online that shows how. Note: There are plenty of examples using older versions of Signalr with .Net Framework, but I can't see an

Calling Signalr method from Controller .Net Core 2.1

Brett Rigby I'm trying to call a method in the signalr Hub class from a (ASP.NET Core) MVC controller, but I can't find an example online that shows how. Note: There are plenty of examples using older versions of Signalr with .Net Framework, but I can't see an