0

I want to know SignalR per-server connection limitations. Let's say that my mobile app is starting a connection to the server. The app is idle for let's say 5 minutes (not data is send from a specific client to the server nor from the server to a specific client, does SignalR can use that connection to serve other users, or SignalR creates a separate connection for each user?

I want to know whether I should use SignalR or just call the server every few seconds. My mobile app will be running in the background on the user's mobile phone and might be active on the user's mobile phone all day long.

4

1 回答 1

1

SignalR 为每个用户提供 1 个连接,您在给定时间可以打开的连接数量完全取决于服务器实现、硬件等。

如果您的应用程序不依赖实时数据,那么轮询是一种合适的方法。但是,如果您确实想要近乎实时的数据,那么我认为每 2-3 次轮询可能与维护开放连接一样繁重。

最后一点,SignalR 可以配置为通过其长轮询传输进行轮询,但它仍将在服务器上维护一个连接对象,只是不会保留请求。这样,SignalR 可以跟踪所有用户,并确保用户收到发送给他们的消息。

于 2013-05-26T20:24:34.887 回答