服务器端SignalR集线器IConnected和IDisconnect不起作用

时间:2012-09-13 14:50:50

标签: asp.net websocket signalr signalr-hub

我刚刚将SignalR中的示例代码翻译成VB.NET,如下所示。当我从客户端调用test时,Connect被正确调用,但从不调用服务器端DisconnectReconnect$.connection.hub.disconnected。还有什么我应该做的?我已经使用IE10,Chrome和FF进行了测试。

已编辑:stateChanged Public Class Status Inherits Hub Implements IDisconnect Implements IConnected Public Function Disconnect() As Threading.Tasks.Task Implements IDisconnect.Disconnect Return Clients.leave(Context.ConnectionId, DateTime.Now.ToString()) End Function Public Function Connect() As Threading.Tasks.Task Implements IConnected.Connect Return Clients.joined(Context.ConnectionId, DateTime.Now.ToString()) End Function Public Function Reconnect(groups As IEnumerable(Of String)) As Threading.Tasks.Task Implements IConnected.Reconnect Return Clients.rejoined(Context.ConnectionId, DateTime.Now.ToString()) End Function Public Sub test() Stop End Sub End Class 正在按预期工作。

{{1}}

0 个答案:

没有答案