I'm connecting to my SignalR hub via a .Net Client, and invoking a function on the server works fine until the connection is lost from resetting IIS. Once the connection is restored automatically, the Invoke no longer works.
I verified in the web app's logging that the .Net client is successfully reconnecting, and the client's connection state is changing back to Connected. But the Invoke call isn't doing anything. Additionally, if I call Wait() on the invoke, it hangs forever.
Code:
//Works fine before connection lost, but hangs after connection restored
myProxy.Invoke("MyServerFunction", param1).Wait();
Any ideas? I should note that this doesn't happen when the client is running locally and connecting to localhost; it only happens when reconnecting to a different server.
I am experiencing the same issue, and have checked with wire shark, but there is no outgoing traffic from my hub to my client. The other way around the communication is flowing correctly!
So far I have not been able to establish a solution, but will keep you posted, just wanted to share my findings.
Added tracing to the hub, and the client and noticed that the hub closes the connection, but the client does not. From the Hub logfile:
And in the logging on the client it keeps using the same connection
Hover there used to be regular messages of the following type, which are no longer being sent.
from this page Signal R on the wire I learned that the {"I":"232"} message means that:A server void method was completed successfully.
Which is correct, as I can see the updates as they are processed in the hub. But when I invoke a method on that same connection ID nothing happens. And that is not strange as the Hub deemed that connection to be dead!
So why is the connection dead on the hub for outgoing messages, but the hub still able to process incomming messages from that connection?
Additional findings: Here it is mentioned that "client side keep alive check is not utilized for the long polling transport" and I found a reference here that this indeed is disabled by default and the last comment on this issue is "...stops receiving communication coming from server..."
If I understand correctly we enable the client keep alive by setting:
GlobalHost.Configuration.KeepAlive
And we have set this, so still why does the client not detect connection death!