Last post Aug 07, 2013 08:25 PM by vghanwat
Aug 07, 2013 08:25 PM|vghanwat|LINK
We have an adapter component and a server component. THe server component acts as a SignalR server and the adapter is SignalR client. The server component also acts as a REST service
We are using Aspnet WebAPI Owin hosting to host our SignalR service.
1. The adapter comes up and starts a hubconnection with SignalR service
2. Once connection is established, server gets requests from REST clients. It then sends down this request to the adapter.
3. THe adapter receives the request and sends it down to our legacy product to get a response.
4 Adapter gets this response and then makes another method call on the server to send back a response. (I had to do this because we can't get a return value on client method calls).
5. Adapter method exits after this.
Everything works fine when I try the above logic on windows 7 and windows 2008. in Fiddler I noticed, SignalR is using ServerSentEvents. All the request processing is done properly
and the response is sent back to REST client properly.
When I move all the components to 2012, SignalR switches to WebSockets transport as expected, but in the logs I start seeing OnConnectionSlow event and everything hangs after that.
I don't see any disconnect event or reconnect event.
After some reading I came across this link where it said":
"Making a Hub method asynchronous avoids blocking the connection when it uses the WebSocket transport.
So I made all the server methods asynchronous. I guess all the client (adapter)methods all called asynchrounously by default by the server
I also removed the Wait() call on the method
After this change I don't see the ConnectionSlow event, but some responses which are large, get lost. I see a Reconnect event after I make this method call on the Server. After
reconnect I see it connected, but the message in the response is lost and I don't see the method on the server being called. I thought the websocket connection should be up and running and we should be able to call a method on the server and send the reponse
If I put back the Wait statement, I start getting OnConnection slow events back for responses with a large message.
I can't get this logic to work using WebSockets transport. For now I have forced SignalR to use ServerSentEvents even on 2012 as a workaround till this issue is fixed.
Please advise on what I need to do.