SignalR not working when system is ideal for some

2019-03-03 22:26发布

问题:

$.connection.myHubName.client.disconnect(function () {
    $.connection.hub.start();
});

on hub.start(); server is started but still it working properly

回答1:

The correct method is hanging off the hub connection itself not the hub (so not the client object).

$.connection.hub.disconnected(function () { console.log('We are currently experiencing difficulties with the connection.') });