当系统处于理想状态时,SignalR无法正常工作 [英] SignalR not working when system is ideal for some time
本文介绍了当系统处于理想状态时,SignalR无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$.connection.myHubName.client.disconnect(function () {
$.connection.hub.start();
});
在hub.start();上服务器已启动,但仍然可以正常工作
on hub.start(); server is started but still it working properly
推荐答案
正确的方法是挂起集线器连接本身而不是集线器(因此 not 客户端对象).
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.')
});
$.connection.hub.disconnected(function () {
console.log('We are currently experiencing difficulties with the connection.')
});
这篇关于当系统处于理想状态时,SignalR无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文