信号器:JavaScript客户端无法在IE上重新连接(parseerror异常)

时间:2013-09-06 05:30:41

标签: javascript .net signalr

配置/设置:

  • Windows 7 64位,.Net 4.5,Visual Studio 2012
  • 自主信号服务器(控制台应用)
  • JavaScript客户端

背景

我开始以this self host tutorial为基础,最终目标是配置可以跨域连接的中心服务器(CORS)。我主要使用版本2.0.0-rc1。

回购步骤:

回购步骤很简单。从好的ol IE(版本10)导航到测试页面(default.html)并等待。

以下是信号器客户端日志,详细说明了发生的情况:

[21:47:30 PDT] SignalR: Auto detected cross domain url. 
 [21:47:30 PDT] SignalR: Client subscribed to hub 'selfieserver'. 
 [21:47:30 PDT] SignalR: Negotiating with 'http://localhost:8889/signalr/negotiate?connectionData=%5B%7B%22name%22%3A%22selfieserver%22%7D%5D&clientProtocol=1.3'. 
 [21:47:31 PDT] SignalR: Opening long polling request to 'http://localhost:8889/signalr/connect?transport=longPolling&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBAAAAAIkua2h4902EBFsaUr1NkAAAAAACAAAAAAADZgAAwAAAABAAAADId6sPY7u1b7U4MSyyjEGgAAAAAASAAACgAAAAEAAAAPbquY3AwSaeBDURBcXbiv8oAAAA5cpbDNk5rm0qDdq6nDWpqiazmTL4R%2Bv%2FI%2FSzcW1eAI71AkllpeDIKxQAAAAfYvObLT5lU2OeXpUvdjR%2B%2BLpotQ%3D%3D&connectionData=%5B%7B%22name%22%3A%22selfieserver%22%7D%5D&tid=8'. 
 [21:47:31 PDT] SignalR: Long poll complete. 
 [21:47:31 PDT] SignalR: LongPolling connected. 
 [21:47:31 PDT] SignalR: Opening long polling request to 'http://localhost:8889/signalr/poll?transport=longPolling&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBAAAAAIkua2h4902EBFsaUr1NkAAAAAACAAAAAAADZgAAwAAAABAAAADId6sPY7u1b7U4MSyyjEGgAAAAAASAAACgAAAAEAAAAPbquY3AwSaeBDURBcXbiv8oAAAA5cpbDNk5rm0qDdq6nDWpqiazmTL4R%2Bv%2FI%2FSzcW1eAI71AkllpeDIKxQAAAAfYvObLT5lU2OeXpUvdjR%2B%2BLpotQ%3D%3D&messageId=d-4213A9B0-B%2C0%7CU%2C0%7CV%2C1%7CW%2C0&connectionData=%5B%7B%22name%22%3A%22selfieserver%22%7D%5D&tid=4'. 
 [21:48:01 PDT] SignalR: An error occurred using longPolling. Status = parsererror.  Response = undefined. 
 [21:48:04 PDT] SignalR: Opening long polling request to 'http://localhost:8889/signalr/reconnect?transport=longPolling&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBAAAAAIkua2h4902EBFsaUr1NkAAAAAACAAAAAAADZgAAwAAAABAAAADId6sPY7u1b7U4MSyyjEGgAAAAAASAAACgAAAAEAAAAPbquY3AwSaeBDURBcXbiv8oAAAA5cpbDNk5rm0qDdq6nDWpqiazmTL4R%2Bv%2FI%2FSzcW1eAI71AkllpeDIKxQAAAAfYvObLT5lU2OeXpUvdjR%2B%2BLpotQ%3D%3D&messageId=d-4213A9B0-B%2C0%7CU%2C0%7CV%2C1%7CW%2C0&connectionData=%5B%7B%22name%22%3A%22selfieserver%22%7D%5D&tid=0'. 
 [21:48:05 PDT] SignalR: Raising the reconnect event 
 [21:48:35 PDT] SignalR: An error occurred using longPolling. Status = parsererror.  Response = undefined. 
 [21:48:38 PDT] SignalR: Opening long polling request to 'http://localhost:8889/signalr/reconnect?transport=longPolling&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBAAAAAIkua2h4902EBFsaUr1NkAAAAAACAAAAAAADZgAAwAAAABAAAADId6sPY7u1b7U4MSyyjEGgAAAAAASAAACgAAAAEAAAAPbquY3AwSaeBDURBcXbiv8oAAAA5cpbDNk5rm0qDdq6nDWpqiazmTL4R%2Bv%2FI%2FSzcW1eAI71AkllpeDIKxQAAAAfYvObLT5lU2OeXpUvdjR%2B%2BLpotQ%3D%3D&messageId=d-4213A9B0-B%2C0%7CU%2C0%7CV%2C1%7CW%2C0&connectionData=%5B%7B%22name%22%3A%22selfieserver%22%7D%5D&tid=1'. 
 [21:48:41 PDT] SignalR: Raising the reconnect event 
 [21:49:08 PDT] SignalR: An error occurred using longPolling. Status = parsererror.  Response = undefined. 
 [21:49:11 PDT] SignalR: Opening long polling request to 'http://localhost:8889/signalr/reconnect?transport=longPolling&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBAAAAAIkua2h4902EBFsaUr1NkAAAAAACAAAAAAADZgAAwAAAABAAAADId6sPY7u1b7U4MSyyjEGgAAAAAASAAACgAAAAEAAAAPbquY3AwSaeBDURBcXbiv8oAAAA5cpbDNk5rm0qDdq6nDWpqiazmTL4R%2Bv%2FI%2FSzcW1eAI71AkllpeDIKxQAAAAfYvObLT5lU2OeXpUvdjR%2B%2BLpotQ%3D%3D&messageId=d-4213A9B0-B%2C0%7CU%2C0%7CV%2C1%7CW%2C0&connectionData=%5B%7B%22name%22%3A%22selfieserver%22%7D%5D&tid=7'. 
 [21:49:18 PDT] SignalR: Raising the reconnect event 
 [21:49:42 PDT] SignalR: An error occurred using longPolling. Status = parsererror.  Response = undefined. 
 [21:49:45 PDT] SignalR: Opening long polling request to 'http://localhost:8889/signalr/reconnect?transport=longPolling&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBAAAAAIkua2h4902EBFsaUr1NkAAAAAACAAAAAAADZgAAwAAAABAAAADId6sPY7u1b7U4MSyyjEGgAAAAAASAAACgAAAAEAAAAPbquY3AwSaeBDURBcXbiv8oAAAA5cpbDNk5rm0qDdq6nDWpqiazmTL4R%2Bv%2FI%2FSzcW1eAI71AkllpeDIKxQAAAAfYvObLT5lU2OeXpUvdjR%2B%2BLpotQ%3D%3D&messageId=d-4213A9B0-B%2C0%7CU%2C0%7CV%2C1%7CW%2C0&connectionData=%5B%7B%22name%22%3A%22selfieserver%22%7D%5D&tid=9'. 
 [21:50:00 PDT] SignalR: Raising the reconnect event 
 [21:50:15 PDT] SignalR: An error occurred using longPolling. Status = parsererror.  Response = undefined. 
 [21:50:18 PDT] SignalR: Opening long polling request to 'http://localhost:8889/signalr/reconnect?transport=longPolling&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBAAAAAIkua2h4902EBFsaUr1NkAAAAAACAAAAAAADZgAAwAAAABAAAADId6sPY7u1b7U4MSyyjEGgAAAAAASAAACgAAAAEAAAAPbquY3AwSaeBDURBcXbiv8oAAAA5cpbDNk5rm0qDdq6nDWpqiazmTL4R%2Bv%2FI%2FSzcW1eAI71AkllpeDIKxQAAAAfYvObLT5lU2OeXpUvdjR%2B%2BLpotQ%3D%3D&messageId=d-4213A9B0-B%2C0%7CU%2C0%7CV%2C1%7CW%2C0&connectionData=%5B%7B%22name%22%3A%22selfieserver%22%7D%5D&tid=8'. 
 [21:50:45 PDT] SignalR: Couldn't reconnect within the configured timeout (30000ms), disconnecting. 
 [21:50:45 PDT] SignalR: Stopping connection. 
 [21:50:45 PDT] SignalR: Aborted xhr requst. 

您可以看到错误不断发生,客户端会一直重新连接,直到重新连接失败。

作为奖励,我创建了一个repro应用程序,您可以从skydrive下载here

如果有人对我的问题有所了解,或者可以直截了当地指出我,那将会成为我的一天。

[UPDATE] 在尝试通过包含的源代码重现的5个开发中,零已经能够重现。

我假设此时我的问题特定于我的机器(呃?)。有了这个假设,什么环境因素可能导致signalr / poll?transport = longPolling请求“中止”?

2 个答案:

答案 0 :(得分:0)

这可能会对您有所帮助:

https://github.com/SignalR/SignalR/issues/1557

请注意作者的评论: “这不是一个错误。这是我们选择的预期设计。将其改为建议。”

答案 1 :(得分:0)

您是否以管理员身份运行Visual Studio?它可能与权限和Owin有关。