简体   繁体   中英

Test Azure SignalR connection on server

In an Asp.net core 3 web app, is it possible to test the server's connection to an Azure SignalR service?

Is there a recommended pattern for handling Server-to-SignalService connectivity issues such as trying to send when not connected and/or reconnecting after encountering disconnected states (if that's even possible / needed)?

You can test the server's connection to an Azure SignalR Service using Azure Functions for example:

https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-signalr-service

About the connectivity:

When the app server starts, in the background, the Azure SDK starts to initiate server connections to the remote Azure SignalR. As described in Internals of Azure SignalR Service, Azure SignalR routes incoming client traffics to these server connections. Once a server connection is dropped, all the client connections it serves will be closed too.

As the connections between the app server and SignalR Service are persistent connections, they may experience network connectivity issues. In the Server SDK, we have Always Reconnect strategy to server connections. As the best practice, we also encourage users to add continuous reconnect logic to the clients with a random delay time to avoid massive simultaneous requests to the server.

https://github.com/Azure/azure-signalr/blob/dev/docs/tsg.md#server-connection-drop

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM