02-27-2012 05:22 AM
I'm using net.rim.device.api.io.transport.ConnectionFactory for connecting to own server using socket. The factory configured with default settings. All transports are preffered, except WAP, BISB configured as public.
The problem is the follows: device tries to establish a connection to server, in sniffer on server-side I see that the device sends multiple 'connect' TCP packets to server with delays 2,2,4,4,8,.. seconds between the packets. Server sends 'accept connect' TCP packet in response on each packet from device, but device continues trying to establish a connection.
It happens sometimes, not always. It happens via stable wifi and via cellular transports. It happens on different server implementations and hostings. It happens on different devices (9700, 9800, 9360) and OSes (5.0, 6.0).
On server, the problem gives exception after device accepting - kind of "socket already closed".
My expectation that device won't try to connect after it receives 'accept' from server.
Has somebody any thoughts about the problem? Thank you for your help.
02-27-2012 05:28 AM
02-27-2012 05:55 AM
Thanks for replies.
First about timeout: originally it was 30 seconds, then I leave it for system, i.e. use default settings (except preffered transports) .
I checked with "interface=wifi" and the problem still reproduced. Also I noticed that BB browser floods HTTP server (apache) on the same computer. But the browser fails to connect within several seconds and HTTP server doesn't accept the connection. I mean apache gracefully handles the floods.
Both tried server implementation use C# framework.
02-27-2012 01:04 PM
What BlackBerry Smartphone model and BlackBerry handheld software version are you testing on? You can find this under Options, About on the BlackBerry Smartphone.
Do you see this when you first attempt the connection or while the connection is active? The ConnectionFactory will attempt connections to the server using the various transport routes to determine which ones are available.
02-28-2012 04:19 AM
Currently I have access only to 9700, version is 188.8.131.522 (platform. 184.108.40.206).
I have a test app, that connects every 10 seconds to server. The problem is reproduced randomly. Sometimes on first connection. Sometimes after few minutes and after few attempts connection succeeds, but then it fails again.
But I already suppose that it's a server related issue, and caused by BB device. I think so, because MS Windows Socket (winsock2) implementation accepts a connection even TCP 'three-way handshake' has not completed yet.
When I confirm it, I will close this topic.