简体   繁体   中英

Signal-R state changes to reconnecting twice

I've been testing an application that uses Signal-R for pushing messages from server to client and have run into a strange issue.

Whenever the Signal-R connection gets broken (say by restarting the server application or stopping IIS, etc.), on the client side I get $.connection.hub.stateChanged cycling through reconnect attempts twice, with and erroneous report that it was reconnected.

Basically I see this:

$.connection.hub.stateChanged triggered, new state is $.signalR.connectionState.reconnecting

$.connection.hub.reconnecting triggered

$.connection.hub.stateChanged triggered, new state is $.signalR.connectionState.connected or $.signalR.connectionState.reconnected

$.connection.hub.stateChanged triggered, new state is $.signalR.connectionState.reconnecting

$.connection.hub.reconnecting triggered

$.connection.hub.stateChanged triggered, new state is $.signalR.connectionState.disconnected

My question is: Why does this cycle through twice, and why does signal-R report that it was reconnected in the middle when it couldn't be (ie if IIS is completely stopped). It's not currently negatively effecting the functionality of my application as far as I can tell, but the strange sequence shows up in our logs and is confusing/concerning to management.

Sounds like you better spend more time testing and debugging your application. One thing to understand, just in case you are not aware, is the life cycle of http requests. This may be a good place to start looking into if you are not familiar with what I'm talking about.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM