In .net client detect signalr Hub server crash - signalr

I want to inform to client of server crash i.e. singnalr hub crash and
call my method in .net client which try to reconnect after 10 secs ,
How to know if server crashed in my .net client

Related

Stop NestJs server process from client

I have a nextJs web application with a nestJS backend, from the webapp I can call the server and it calls a gRPC process and returns information back to the client. How do I terminate this process when it's still running? Simply closing the browser window or using new AbortController() only kills the API call between server and client but does not kill the server process that is still fetching data from gRPC.
If you want to shut down your nestJS application use
process.exit()
which terminates the running node process.

SignalR server to server communications

I have an application that uses SignalR to broadcast data to all connected clients. Its a .NET6 Blazor Wasm hosted web application. Now, I want the the broadcaster (which is running on the Blazor server) to connect to a data source that is outside my website, and get data from there. The source data is being broadcast via UDP on a different network.
So my question is, is it possible that my SignalR hub that is running on the Blazor server connects to another SignalR hub running on a different machine in a different network and get real time data from it? Or may be I can run a SignalR client as well on my Blazor server and then connect to a machine on another network? Can I run a SignalR hub on the UDP source machine to which my Blazor server SignalR hub or client can connect? From what I have read, SignalR only runs on a website. Or is it that SignalR is not suitable for this kind of server to server data feeds?

RSocket controller sending Reactor Flux message to IIS hosted signalR client but nothing is received

In a dev environment a local IIS and signalR client web app creates a session with a spring boot RSocket server, and message flow is working fine.
After deployment to another server and a fresh IIS install, the signalR client can send messages to the server, creating a session from IIS port 6060 to server configured port, X (instead of 8082).
However, after the spring boot reactor Flux sends messages on port X back to the signalR client the messages are not being received by the client.
It's as if the IIS and signalR can fire and forget a send message to port X but not get a session that the port X can reply on.
Can anyone shed light on what's happening?
With a fresh install of the IIS <-> SignalR <-> RSockets <-> WebFlux messaging stack on another demo server and the same error appeared to happen. Though did not run TCP packet captures to check the send / receive message situation with Wireshark.
First of all per SignalR .Net Core 3.1 Web Application not working on local IIS the IIS WebSockets feature was not switched on.
Then, per SignalR 2.2 returns 404 Not Found on IIS 8.5 the requests to the server returned 404 errors. A / was discovered in a JSON date String in urlAPI was causing call to
using (_myStream = new StreamReader(await client.GetStreamAsync(urlAPI)))
to find another endpoint in the urlAPI that did not exist, producing HTTP 404 errors. So that was due to malformed URL.

SignalR connection pooling

I have 2 separate ASP.Net sites, one is outward facing serving the UI and the other is a backend API that is only ever accessed by the UI server.
We are using SignalR to push events through the client but these events originate on the backend API so there is a SignalR connection from browser -> UI Server and another from UI Server -> Backend API.
Currently each client that connects SignalR from the browser causing a new connection to be made to the backend API. This means that we have a lot of connections for the same hubs through between the same processes.
Is there any way in SignalR to have it pool the connections so they use the same underlying sockets while hiding that abstraction from my code in the SignalR .Net Client?

determine client reconnect to server

I use client disconnect event on the server to determine when the client disconnected from the server. But I need to know when the client has reconnected. Can I do this? I am running SignalR in a WebView on a mobile device and I assume loss of signal causes SignalR disconnect to fire on the server
Try having your Hub implement the IConnected interface, more info here.
This gives you these methods:
Task Disconnect()
Task Connect()
Task Reconnect(IEnumerable<string> groups)

Resources