views:

53

answers:

0

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.