gpt4 book ai didi

javascript - Signalr:JavaScript 客户端无法在 IE 上重新连接(parseerror 异常)

转载 作者:数据小太阳 更新时间:2023-10-29 04:21:34 24 4
gpt4 key购买 nike

配置/设置:

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

背景:

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

repo 步骤:

repo 步骤很简单。从 good '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.

可以看到错误不断出现,客户端不断重连,直到重连失败。

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

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

[更新]在试图通过包含的源代码重现的 5 名开发人员中,零人能够重现。

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

最佳答案

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

关于javascript - Signalr:JavaScript 客户端无法在 IE 上重新连接(parseerror 异常),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18650548/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com