SignalR长轮询在5秒内断开 [英] SignalR long-polling is disconnected in 5 seconds

查看:557
本文介绍了SignalR长轮询在5秒内断开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序工作在企业网络(丑陋的代理和东西)。它并不能很好地工作。我希望使用https会帮助,但事实并非如此。这是一个奇怪的图案我在日志中看到:

My application is working under corporate network (ugly proxies and stuff). And it does not work very well. I hoped using https would help but it did not. Here is a weird pattern I see in the logs:

[14:13:32 GMT+0600 (N. Central Asia Standard Time)] SignalR: Client subscribed to hub 'modemshub'.
[14:13:32 GMT+0600 (N. Central Asia Standard Time)] SignalR: Negotiating with '/signalr/negotiate?clientProtocol=1.5&connectionToken=6aktO0sramoQKhQ9DC7Cs7EbXMUou8LooQRxfup4R0oZCHpBmWBFjyLup%2F3wJLloR8GtJEiUk10YOZJBaSqN8aiGAfXRR4G9hujTFTyiJiz%2FyJ4oMlBIdxqeCc5anI6k&connectionData=%5B%7B%22name%22%3A%22modemshub%22%7D%5D'.
[14:13:32 GMT+0600 (N. Central Asia Standard Time)] SignalR: longPolling transport starting.
[14:13:32 GMT+0600 (N. Central Asia Standard Time)] SignalR: Opening long polling request to 'https://example.com/signalr/connect?transport=longPolling&clientProt…rlCzGHl5kVLClT5ex8&connectionData=%5B%7B%22name%22%3A%22modemshub%22%7D%5D'.
[14:13:33 GMT+0600 (N. Central Asia Standard Time)] SignalR: Long poll complete.
[14:13:33 GMT+0600 (N. Central Asia Standard Time)] SignalR: LongPolling connected.
[14:13:33 GMT+0600 (N. Central Asia Standard Time)] SignalR: longPolling transport connected. Initiating start request.
[14:13:33 GMT+0600 (N. Central Asia Standard Time)] SignalR: Opening long polling request to 'https://example.com/signalr/poll?transport=longPolling&clientProtoco…rlCzGHl5kVLClT5ex8&connectionData=%5B%7B%22name%22%3A%22modemshub%22%7D%5D'.
[14:13:33 GMT+0600 (N. Central Asia Standard Time)] SignalR: The start request succeeded. Transitioning to the connected state.
[14:13:38 GMT+0600 (N. Central Asia Standard Time)] SignalR: Long poll complete.
[14:13:38 GMT+0600 (N. Central Asia Standard Time)] SignalR: Stopping connection.
[14:13:38 GMT+0600 (N. Central Asia Standard Time)] SignalR: Fired ajax abort async = true.

因此​​,在建立连接和5秒后,它被中止(而ConnectionTimeout等于110秒)。而这种模式被一再重复。这只是奇怪。

So the connection is established and 5 seconds later it is aborted (while ConnectionTimeout equals to 110 seconds). And this pattern is repeated again and again. That's just weird.

推荐答案

好像这种行为是由一个错误,在SignalR 2.1引起的。有一个类似的错误报告: https://github.com/SignalR/SignalR/issues/3557 < /一>因此,我们下调SignalR到2.0.3和这种行为消失了。

Seems like this behaviour is caused by a bug in SignalR 2.1. There was a similar bug reported: https://github.com/SignalR/SignalR/issues/3557 So we downgraded SignalR to 2.0.3 and this behaviour disappeared.

这篇关于SignalR长轮询在5秒内断开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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