I have a problem with SignalR jQuery client given the following scenario:
- The server is hosted on Azure as a worker role
- REST APIs are implemented with WebApi2
- Push hubs are served with SignalR
- There are 2 clients:
- Android
- Webapp based on angularjs which uses ui-router and SingnalR jQuery client in the main state of the application (this state dies when the webapp is closed)
Here is how i get the anomaly:
- Android client calls a REST API that invokes the push hub on the server. The push hub sends a notification to the angular client
- The angular client receives the notification and calls another api on the server that sends a GCM notification on the Android client. When the client receives 200 OK as response to the called REST API, it calls another API hosted on a server running in localhost (with CORS enabled)
- At this point SignalR client disconnects from the server, without being able to reconnect to it in a stable manner: it keeps disconnecting and reconnecting
- This anomaly occurs if the angular client stays alive for several minutes (say, hours)
- Refreshing the page fixes the problem
Do you have ideas about how to fix this problem without refreshing the page?
Thanks in advance