SignalR& IE问题 - 民意调查正在审理中 [英] SignalR & IE Issue - poll is pending

查看:229
本文介绍了SignalR& IE问题 - 民意调查正在审理中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有IE和SignalR的问题,我正在使用它在两个数据库之间执行同步操作,在所有情况下,操作在Google Chrome / Firefox / Safari上成功完成。

I have a Problem With IE and SignalR, I'm using the it to perform a Syncing action between two databases, the Actions Completed successfully on Google Chrome / Firefox / Safari in all scenarios.

第一次使用IE时,同步执行成功但只有一次,第二次是挂起的请求堆栈和页面永远冻结。
我在网上找到了一个改变传输模式的解决方案。
但页面仍然冻结。

Using IE for the First time the sync performed successfully but only for one time, in the second time a pending request stack and the page stay freeze for ever. I found a solution online which is changing the transport mode. But page still freezing.

if (isIE()) {
   $.connection.hub.start({ transport: ['serverSentEvents','foreverFrame']}).done(function () {
       progressNotifier.server.DoMyLongAction();
   });
}else{
   $.connection.hub.start({ transport: ['serverSentEvents','longPolling'] }).done(function () {
       progressNotifier.server.DoMyLongAction();
   });
}

我正在使用:
SgnalR v2.1.0.0
.Net framework v4.5
jquery v1.8

I'm Using: SgnalR v2.1.0.0 .Net framework v4.5 jquery v1.8

这是一个问题还是我做错了什么?

is it an Issue or I'm Doing something wrong ?

编辑

我的应用程序使用Jquery进度条,我使用此代码更新此进度条:
服务器端:

my application use Jquery progress bar and i Update this progress bar using this Code: server side:

Clients.Caller.sendMessage(msg, 5, "Accounts");

客户端:

progressNotifier.client.sendMessage = function (message, value, Entity) {
      pbar1.progressbar("value", nvalue);
};

它正在使用Firefox,所以我认为这是一个signalR问题!!现在我感到困惑,如果它按预期工作,那么是什么导致了这个问题?

it's working on Firefox so I thought it's a signalR Issue !! Now i became confused if it's working as expected then what causes this problem ?

推荐答案

你在网上找到的解决方案不太可能有帮助你的问题。

The solution you found online is not likely to help your issue.

我怀疑你的 IsIE()函数是否正确识别IE。如果是,SignalR应该只是尝试建立foreverFrame连接,因为IE甚至不支持serverSentEvents。我不希望IE发出任何/ signalr / poll请求,因为这些请求只能通过longPolling传输进行。

I doubt your IsIE() function is correctly identifying IE. If it was, SignalR should only be attempting to establish a "foreverFrame" connection, since IE does not even support "serverSentEvents". I would not expect IE to make any "/signalr/poll" requests, because those requests are only made by the "longPolling" transport.

此外,还有待定 IE F12工具的网络选项卡中的轮询请求完全可以预期。这就是 long 民意调查的工作方式。基本上,一旦收到消息,客户端就会发出新的ajax请求(长轮询)来检索新消息。如果没有立即可用的新消息,服务器将等待(在SignalR的情况下默认为最多110秒,而不是永远),以便在使用新的响应待处理的长轮询请求之前将新消息发送到客户端消息。

Also, having a "pending" poll request in the IE F12 tool's network tab is entirely expected. This is how long polling is designed to work. Basically, as soon as a message is received the client makes a new ajax request (a long poll) to retrieve new messages. If no new messages are immediately available, the server will wait (for up to 110 seconds by default in the case of SignalR, not forever) for a new message to be sent to the client before responding to the pending long poll request with the new message.

除了看到网络标签下显示的待处理轮询请求之外,您能否准确说明您遇到的问题?如果您启用了跟踪功能,也会有所帮助JS客户端,提供控制台输出,并在网络选项卡中显示所有/ signalr / ...请求。

Can you clarify exactly what issue you are having other than seeing a pending poll request showing up under the network tab? It would also help if you you enabled tracing in the JS client, provided the console output, and showed all the "/signalr/..." requests in the network tab.

这篇关于SignalR& IE问题 - 民意调查正在审理中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆