9

配置/设置:

  • Windows 7 64 位、.Net 4.5、Visual Studio 2012
  • 自托管 Signalr 服务器(控制台应用程序)
  • JavaScript 客户端

背景:

我以这个自托管教程作为我的基础,最终目标是配置一个可以跨域 (CORS) 连接的集线器服务器。我主要使用 2.0.0-rc1 版本。

回购步骤:

回购步骤很简单。从 good 'ol IE (version 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 下载它

如果有人对我的问题有一些见解或者可以直接指出我的正确方向,那会让我很开心。

[更新] 在尝试通过包含的源代码进行复制的 5 个开发人员中,零个能够复制。

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

4

2 回答 2

0

This may help you:

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

Note the comment from the author: "This isn't a bug. It's the intended design we chose. Changing this to a suggestion."

于 2013-09-06T15:21:49.183 回答
0

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

于 2013-09-06T18:43:00.157 回答