gpt4 book ai didi

signalr - 无法成功初始化任何传输。尝试为自动初始化指定不同的传输方式或根本不指定传输方式

转载 作者:行者123 更新时间:2023-12-02 13:33:09 25 4
gpt4 key购买 nike

我没有在hubConnection.start()中指定任何传输,但仍然出现传输失败。我使用的是 IE 10 和 IIS 8.0。谁能告诉我出了什么问题吗?

连接SignalR服务器的代码:

    $(document).ready(function () {
var hubConnection = $.hubConnection("http://myserver.com:8031");
var notificationHub = hubConnection.createHubProxy("Notification");
hubConnection.logging = true;

notificationHub.on("calculationResultReceived", function (result) {
addLog("Time elapsed: " + result.timeElapsed + ", finalResult: " + result.finalResult+ ", ID: " + result.jobId);
}
});

hubConnection.start().done(function () {
notificationHub.invoke("Echo")
.done(function (msg) { addLog("Notification hub connection established successfully" + "\n" + msg); })
.fail(function (message) { addLog("Failed to register push channel"); });
}).fail(function (message) {
addLog("The connection cannot be established: " + message)
});
});

IE10的控制台日志:

[23:10:06 UTC+0800] SignalR: Client subscribed to hub 'notification'. [23:10:06 UTC+0800] SignalR: Negotiating with 'http://myserver.com:8031/signalr/negotiate?connectionData=%5B%7B%22name%22%3A%22notification%22%7D%5D&clientProtocol=1.3'. [23:10:07 UTC+0800] SignalR: This browser doesn't support SSE.
[23:10:07 UTC+0800] SignalR: Binding to iframe's load event.
[23:10:12 UTC+0800] SignalR: foreverFrame timed out when trying to connect. [23:10:12 UTC+0800] SignalR: Stopping forever frame.
[23:10:12 UTC+0800] SignalR: Opening long polling request to 'http://myserver.com:8031/signalr/connect?transport=longPolling&connectionToken=c39XZZSbiQZDnXbf6vOm8zt8wTQrStyPg8qchxWFevyp9BN2yxslU6YAahRdrsy7W0LOc%2BW5FMfRhQe10o%2B2ihlprs9803heDkD2S1Qo4j8oI1kmUA5fPXoBlcP3Ygrk&connectionData=%5B%7B%22name%22%3A%22notification%22%7D%5D&tid=6'. [23:10:17 UTC+0800] SignalR: longPolling timed out when trying to connect. [23:10:17 UTC+0800] SignalR: Aborted xhr request.
[23:10:17 UTC+0800] SignalR: Stopping connection. [23:10:17 UTC+0800] SignalR: Fired ajax abort async = true.

添加1

我检查了 IIS8 安装,并启用了 WebSocket 功能。但仍然是同样的错误,尽管错误消息发生了一些变化。 enter image description here

最佳答案

尝试在 Visual Studio 中禁用浏览器链接功能。要禁用浏览器链接,请单击“浏览器链接”下拉列表并取消选中“启用浏览器链接” ( Using Browser Link in Visual Studio 2013 )。

(来源:github.com/SignalR,作者:netsrotr)

关于signalr - 无法成功初始化任何传输。尝试为自动初始化指定不同的传输方式或根本不指定传输方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24657536/

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