dotnet/aspnetcore

Url can't be changed for easy reconnect

Open

#5 342 ouverte le 1 oct. 2018

Voir sur GitHub
 (12 commentaires) (2 réactions) (0 assignés)C# (10 653 forks)batch import
affected-fewarea-signalrblockedenhancementfeature-client-javafeature-client-javascriptfeature-client-nethelp wantedseverity-minor

Métriques du dépôt

Stars
 (37 933 stars)
Métriques de merge PR
 (Merge moyen 16j 9h) (258 PRs mergées en 30 j)

Description

Using a client-side cursor (e.g. lastId processed); for a reconnect this wants to be passed back to the server in the query string (as cors doesn't allow custom headers and cors is always applicable to websockets).

However while signalR.HubConnectionBuilder() provides easy construction of the connection; the url cannot be changed after building.

This means if the connection disconnects and you need to pass a cursor (e.g. id); the connection has to be rebuilt and all the events re-registered to the new connection.

It would be easier if the url could be updated and only .start needed to be called again.

Guide contributeur