Microsoft.Azure.SignalR.ServiceConnectionManager`1.WriteAsync(ServiceMessage serviceMessage) Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
See original GitHub issueNet Core version: 2.2 Microsoft.Azure.SignalR : 1.0.4 Application type: Web API
Hi, we are experiencing a strange scenario when we are using Azure SignalR 1.0.4. We have different groups that we create for different types of messages that needs to be sent out to the clients that subscribe to these groups. They usually get them but then some times they stop getting the messages but we can still see that our SendAsync method is called. We are also seeing a few exceptions that show up regularly saying:
Microsoft.Azure.SignalR.ServiceConnectionManager`1.WriteAsync(ServiceMessage serviceMessage)
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
We have tried a few different approaches that has been mentioned in other issues that have revolved around clients not reciving messages but with no luck. Hopefully you can help us out.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (7 by maintainers)
Top GitHub Comments
@brread For this issue, it happens when server does not yet connected to Azure SignalR Service however DI gets the
IHubContext
and tries to send message to Azure SignalR Service, so it is a right behavior to throw an exception in such case.I’m confused by the resolution of this issue. It looks like the code change that @vwxyzh pushed in just gives a more descriptive error message.
What does “The Service Connection Is Not Connected” mean?
Is this related to using DI on the
IHubContext
? (Or theHubLifetimeManager
). Does something about this method affect the Service connection?