I am facing a bit of an issue with signalr client connectivity. I am using longpolling transport to create a connection between my server and a .net based client. After a while(some six, seven hours) the connection dies and the client throws an error. I am trying to re-establish a connection as follows:
void hubConnection_Error(Exception obj)
{
System.Windows.Application.Current.Dispatcher.Invoke(
System.Windows.Threading.DispatcherPriority.Normal,
(Action)delegate()
{
this.hubConnection.Start(new LongPollingTransport()).Wait(5000);
});
}
Is this a good approach? I am still trying to figure out the issue on the server side, but until then will this re-establish the connection once the error occurs?
Many thanks.