Setup:
- SignalRServer console app: Microsoft.AspNet.SignalR.SelfHost v2.0.3
- SignalRClient console app: Microsoft.A
I has several similar problems with SignalR (not exacly in the same scenario).
The problem was usually caused in communication model request_from_server->client->response_to_server. When I tried to call Invoke in client code (to send response to server) directly in the receiving procedure, I got strange behavior (infinite waits, strange side effects, etc.).
Solution was to divide process into two threads. One for receiving messages from server to local ConcurrentQueue. The second thread fetches messages from the queue, processes them and sends responses back to server (by Invoke). Now SignalR works as expected.
This issue was probably caused by trying to send response BEFORE receiving procedure finished. This does not happen in usual client->server->client communication model.