You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
Today since we only have an event for Disconnect, it makes it hard to write linear code that does something until the client disconnects. It should be possible to write a reconnect loop like this:
while(true){// Create a new connection varconnection=newHubConnectionBuilder().WithUrl("http://localhost:5000/cache").WithMessagePackProtocol().WithConsoleLogger().WithTransportType(TransportType.WebSockets).Build();// Start itawaitconnection.StartAsync();// Do things while the connection is alive and wait for it to finishawaitconnection.Lifetime.AsTask();// Dispose when it's doneawaitconnection.DisposeAsync();}
Today since we only have an event for Disconnect, it makes it hard to write linear code that does something until the client disconnects. It should be possible to write a reconnect loop like this: