SignalR连接协商失败

时间:2018-07-20 19:48:31

标签: angular typescript signalr asp.net-core-signalr

我正在尝试在Angular应用程序中使用SignalR。我正在使用Typescript客户端/var/run/secrets/kubernetes.io/serviceaccount/token

我在控制台中得到的是

  

信息:将'/ api / signalr?connectionData =%5B%7B%22name%22%3A%22myhub%22%7D%5D'标准化为'http://server:port/api/signalr?connectionData=%5B%7B%22name%22%3A%22myhub%22%7D%5D'。

     

调试:启动HubConnection。

     

调试:以传输格式“文本”开始连接。

     

调试:发送协商请求:   http://server:port/api/signalr/negotiate?connectionData=%5B%7B%22name%22%3A%22kanbanhub%22%7D%5D

     

错误:无法启动连接:TypeError:无法读取未定义的属性'length'

错误似乎来自override init() { super.init() self.isUserInteractionEnabled = true } var actionTouchUpInside: Selector? var actionTouchUp: Selector? var actionTouchDown: Selector? weak var targetTouchUpInside: AnyObject? weak var targetTouchUp: AnyObject? weak var targetTouchDown: AnyObject? func setButtonAction(target: AnyObject, triggerEvent event:SKButtonActionType, action:Selector) { switch (event) { case .TouchUpInside: targetTouchUpInside = target actionTouchUpInside = action case .TouchDown: targetTouchDown = target actionTouchDown = action case .TouchUp: targetTouchUp = target actionTouchUp = action } } override public func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { if let touch = touches.first { let location = touch.location(in: parent!) if self.contains(location) { // Code for performing the action } } } 中的行@aspnet/signalr。可能与协商响应不包含if (!(_i < transports_1.length)) return [3 /*break*/, 9];数组这一事实有关。

HttpConnection

知道为什么吗?

1 个答案:

答案 0 :(得分:0)

问题似乎是我在客户端使用ASP.NET Core SignalR和在服务器端使用ASP.NET SignalR,

我应该使用@aspnet/signalr而不是signalr