gpt4 book ai didi

azure - 在服务器上测试 Azure SignalR 连接

转载 作者:行者123 更新时间:2023-12-03 04:08:19 27 4
gpt4 key购买 nike

在 Asp.net core 3 Web 应用程序中,是否可以测试服务器与 Azure SignalR 服务的连接?

是否有推荐的模式来处理服务器到 SignalService 连接问题,例如在未连接时尝试发送和/或在遇到断开状态后重新连接(如果可能/需要)?

最佳答案

您可以使用 Azure Functions 测试服务器与 Azure SignalR 服务的连接,例如:

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

关于连接:

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

关于azure - 在服务器上测试 Azure SignalR 连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58405586/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com