02-08-2011 04:16 PM
I have a pretty weird issue:
My application successfully connects to a service, where it sends and receives some Json content. Writing and reading are succesfuly working in 2 independent threads that share the same connection. The amount of data received is in medium around 1kb / second. Data sent 20 bytes / 10 seconds - this acts as a keep-alive mechanism.
What happens is that connection drops after 1 minute or so giving me either "java.io.InterruptedIOException: Local connection timed out after ~ 120000", or "net.rim.device.api.io.ConnectionClosedException" ... But, this happens only for BES/MDS, BIS and Wap2.0. Via Direct TCP or Wi-Fi everything is fine ...
I am far from being an MDS expert, but is there some extra handling for these 3 connection modes?
Solved! Go to Solution.
02-09-2011 04:55 PM
That didn't work ... To give further description for this: When I receive data from server I don't get these exceptions ... If server stops sending them (I send an application protocol specific message), then after 1 minute or so - in this time, once per 10 seconds I am sending these keep-alive messages, let's call them heartbeats - connection drops. But only for BES, BIS and Wap. Everything is fine on Direct TCP and Wi-Fi.
Doing this test from an MDS simulator, shows that connection is dropped by MDS simulator, as I am getting IOException on DataInputStream.read() method.
I tried to add socket.setSocketOption(SocketConnection.KEEPALIVE, 1); but that didn't help.
Do you have any clue what might be the reason for all these?
10-20-2011 04:31 AM
Getting back long after the issue was fixed: it turns out the phisical connection was not closed ... I am just catching this exception and don't do anything else. Reading will not be affected in subsequent data deliveries.