Last post Oct 20, 2014 10:55 PM by Kevin Shen - MSFT
Oct 19, 2014 09:50 PM|.NETMaster|LINK
I am trying to create a application where the client is the browser. Below is a typical scenario on what my app will do and I am wondering if SignalR is the right for this.
Client loads a url: http://someURL/123 where the 123 is the identity of the page(customer), this is the viewer which only displays info.
(I send the hub ID to the server and save this as the last connectionID so I can only update this when the next thing happens)
Now this client can go in the backend system and if they update their data, then the server will notify the
http://someURL/123 that the data has been updated and needs to be refreshed, since I saved the last hub connection ID this is all possible)
So far I have done all this and it works, however the problem is how reliable will this be if some customers never really update their data, and some may update it every day, some every month, some never. This is not predicable on how often they will update
Is there a way to keep SignalR connection to server alive all the time so the hub connection id that was saved a month ago is still valid.
Also what happens if the web app(iis) is reset? how can i have all the clients re-establish the connection.
How long does browser keep the connection live to server with the defaults?
Is what I am trying to achieve doable and reliable with SignalR or should I be looking at other things?
minutes and most of the time these calls will be pointless as data hardly ever changes. I do not want to go this route that is why I tried doing this using SignalR
Oct 20, 2014 10:55 PM|Kevin Shen - MSFT|LINK
First ,If you want to keep the SignalR connection all the time ,that means you need to automatically re-establish a connection
after it has been lost and attempt to reconnect has timeout. To do that you need to call Start method from the Clost event handler,
Please refer to the links below:
Second, if the server disconnect,SignalR also can notify user and reconnect ,I suggest you can refer the link below about understanding and
handling connection lifetime Events in signalR