Java Windows Mobile 应用程序重新建立网络连接所需的时间过长

发布于 2024-08-11 06:04:26 字数 891 浏览 5 评论 0原文

我们有一个 Java 应用程序在 Windows mobile 6.1 上的 JBed JVM 上运行。

当失去连接时,应用程序需要很长时间(8 - 10 分钟)才能重新建立 VPN 网络连接,尽管其他应用程序可以更快地看到 VPN(大约 2 - 3 分钟)。

从我们的应用程序日志中,我们可以看到两个网络调用(彼此独立) - 一个用于在 VPN 上建立设备的 IP 地址 (InetAddress local = InetAddress.getLocalHost),一个用于打开套接字 (connection = new Socket) (主机的 IP 地址、端口);)在连接完全缺失期间和一旦连接恢复到其他应用程序期间都会反复失败,但两个调用似乎同时重新获得对网络的访问权限(第一个调用)成功尝试打开套接字发生在成功获取 IP 地址后第一次尝试时)。

我们学到/知道的其他一些事情:

1) 设备 IP 地址不用于打开套接字 - 它们是在单独线程中运行的单独例程。我的感觉是,一个人的失败不会导致另一个人的失败,而是他们都基于相同的根本原因而成功/失败。

2) 在此期间建立 IP 地址的调用并未失败,只是看不到 VPN 连接 - 蜂窝网络连接 IP 地址可见。当我提到成功/失败时,并不是抛出异常,而是在正确的 IP 范围内看到网络连接。

3)如果您终止进程并重新启动应用程序,它可以正常连接,但是在启动时没有运行真正的代码可以解释这一点 - 只是相同的两个调用。

4) 尝试打开套接字时使用服务器的 IP 地址来建立连接(而不是需要解析的名称)。

5)一种叫做检查点的东西被用来管理网络连接——不知道它是否有贡献。

我认为 JVM 级别可能存在某种缓存/池,从而导致了这种情况。

有谁对可能造成的影响以及我们可以采取哪些措施来阻止它有任何想法吗?

哦,这是 Java 1.2。

We have a Java application running on the JBed JVM on Windows mobile 6.1.

When it loses connectivity the application is taking a long time (8 - 10 minutes) to re-establish VPN network connectivity, despite the fact that other applications can see the VPN far sooner (roughly 2 - 3 minutes).

From our application logs we can see that two network calls (each independent of the other) - one to establish the IP address of the device on the VPN (InetAddress local = InetAddress.getLocalHost), one to open a socket (connection = new Socket(IP address of host, port);)are failing repeatedly during both the period where the connection is completely absent and once the connection has been restored to other applications but both calls seem to regain access to the network at the same time (the first successful attempt to open a socket happens the first time it is attempted after a successful IP address is obtained).

Some other things we've learned / know:

1) The device IP address is not used in opening the socket - they are separate routines running in separate threads. My feeling is that the failure of one does not cause the other, rather they both succeed / fail based on the same underlying reason.

2) The call to establish the IP address isn't failing during this period, it's just not seeing the VPN connection - the cellular network connection IP address is visible. When I refer to success/failure it's not an exception being thrown, it's about it seeing a network connection in the right IP range.

3) If you kill the process and restart the application it connects fine, but there's no real code running on start up which could account for that - just the same two calls.

4) The attempt to open the socket uses the IP address of the server to make the connection (as opposed to a name it would need to resolve).

5) Something called Checkpoint is being used to manage the network connectivity - not idea if it may be contributing.

I'm thinking that there could be some sort of caching / pooling going on at the JVM level which is causing this.

Does anyone have any thoughts on what might be contributing and anything we could try to prevent it?

Oh, and it's Java 1.2.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文