-
Notifications
You must be signed in to change notification settings - Fork 447
Expose a connection state from HubConnection #2127
Comments
Also need state on JS client. |
Only that SendAsync can still throw if the connection/transport gets disconnected after the check and before actually sending data... |
Yep. |
when will this be released? Microsoft.AspNetCore.SignalR.Client Version 1.0.2 doesn't include this. I assume the 2.2.0 means Asp.Net Core 2.2? Why not sync SignalR versions to match Asp.Net Core to easily see which version has the fix? |
1.1, which will ship with ASP.NET Core 2.2
We'll sync it in 3.0 |
I just read the ASP.NET Core 2.2 Roadmap and this means we have to wait until end of this year to get the fix, correct? |
That's correct. There are packages on the myget feed if you want to try them out right now but the final build will be with ASP.NET Core 2.2 |
so I have to use this version? |
the version works and I see the State property. How reliable are the 1.1 previews? Will we see radical API changes or only for 3 builds? btw, it would be better to have 2 feeds (1 feed for 3.0 and 1 for 2.2/1.1). |
I've tested the nightly versions a bit more, but it doesn't work the same like in the old SignalR. In my case 3 time the state is disconnected and I start 3 connections not only 1 like in old SignalR.
|
That's right, they work very differently.
Can you clarify what you mean? There's no intermediate states, there's disconnected and connected. There's no automatic reconnect either so when disconnected, you need to manually reconnect. |
In each method I call a Connect method which checks the State to check if the connection is already connected and if not I start the connection. this works fine for old SignalR and I only have 1 connection. Now for the first 3 calls the state is always disconnected and I have 3 connections from 1 client. |
Do you mean you have 3 different hubs? |
no, 1 hub like in old SignalR. I copied the old code and made some required changes to get it working with new SignalR (remove overloads for example) |
Can you provide a sample project with repro steps? |
We should expose a ConnectionState enum from the HubConnection so that it's possible to avoid throwing from SendAsync if the HubConnection wasn't connected. Today it requires you storing your own bool and setting it in the Closed event.
The text was updated successfully, but these errors were encountered: