有没有办法检测“几乎”?远程桌面断开连接(即短暂的高延迟)?

发布于 2024-09-11 07:38:19 字数 624 浏览 9 评论 0原文

我在一家贸易公司工作,我们的用户通过远程桌面连接到物理上位于交易所设施内的服务器,与主要交易应用程序进行交互。

我们软件的一个功能是,如果网络出现问题并且 RD 会话断开连接,它会自动断开连接并提取所有报价。

检测这一点是通过重写应用程序主窗体的 WndProc 方法来完成的,其中检查消息参数:

Msg == WM_WTSSESSION_CHANGE

和:

WParam.ToInt32() == WTR_REMOTE_DISCONNECT

在远程桌面完全断开连接的正常情况下,这似乎非常有效。

然而,有时用户会遇到短暂的明显断开连接,RD 会话变得无响应(即,单击不执行任何操作),但显然未接收/处理上述消息。在几分钟内(通常约为 10 秒),用户会看到消息“正在重新连接到远程桌面...”(或类似的内容),并且 RD 会话突然开始再次响应。

由于这种在远程桌面上拉引号断开连接功能的整个想法是为了防止出现这样的情况:基本上,我们的应用程序在用户无法看到正在发生的情况的情况下进行交易,因此我们非常希望能够检测 RD 会话何时处于我将描述的“几乎断开连接”状态。

有人知道我们如何检测到这一点吗?

I work for a trading company where our users interact with the primary trading application via a Remote Desktop connection to a server that's physically located within the exchange's facilities.

A feature of our software is that it disconnects and pulls all quotes automatically if something goes wrong with the network and the RD session becomes disconnected.

Detecting this is accomplished by overriding the WndProc method of the application's main form, where the message parameter is checked for:

Msg == WM_WTSSESSION_CHANGE

and:

WParam.ToInt32() == WTR_REMOTE_DISCONNECT

This seems to work great in normal cases of the remote desktop becoming completely disconnected.

However, it sometimes happens that the users experience a short period of apparent disconnection, where the RD session becomes unresponsive (i.e., clicking doesn't do anything) but apparently the message described above is not received/processed. Within a few moments -- usually ~10 seconds -- the user sees the message "Reconnecting to remote desktop..." (or something like that) and suddenly the RD session starts responding again.

Since the whole idea of this pull-quotes-on-remote-desktop-disconnect feature is to prevent the scenario where, basically, our application is trading without the user being able to see what's happening, it's very desirable for us to be able to detect when the RD session is in what I'll describe as this "almost disconnected" state.

Anybody know how we could detect this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

面犯桃花 2024-09-18 07:38:19

我唯一的建议是不断 ping 交换服务器,如果 ping 延迟太高,请断开连接。

我认为交易所不会欣赏这个想法。

My only suggestion would be to constantly ping the exchange server, and if the ping latency gets too high, disconnect.

I don't think the exchange would appreciate this idea.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文