Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
ennova2005
Posts: 96
Registered: ‎07-26-2008
My Device: Not Specified

Cause of Local connection timed out after ~ 130000 ( TCP Socket )

"Local connection timed out after ~ 130000"

 

A tcp socket connection connected through the BES/MDS will not stay connected for long (2-5 minutes).

Just for clarification - this is not a http connection - it is a vanilla TCP socket connection for an always connected messaging application.

 

This happens with BES connected devices but not BIS.  4.2 and 4.5 devices have reported it. We captured the error while troubleshooting on a JDE connected device. We also have anecdotal information from users that Wi-Fi connected devices dont show this behaviour either.

 

We have fixed the max bytes per connection setting on the MDS ( Under Flow Control, increase the Maximum KB/Connection value to 1024)  and that also verified that that limit is not being hit.

 

What causes this error ? How can we work around it ?

 

Can we pass on a different much higher timeout in the connection string like ;ConnectionTimeout=600000 or similar. Will that affect this issue  ?

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,609
Registered: ‎07-14-2008
My Device: Not Specified

Re: Cause of Local connection timed out after ~ 130000 ( TCP Socket )

I have successfully used ConnectionTimeout to shorten the timeout from the default 2 minutes (which is the limit you seem to be hitting), so this is definitely an option for you that I would try.

 

Of course you could always have some sort of heartbeat transmission from the Server which the BB ignores but will keep the connection alive.

 

However do you really need to maintain the connection?  It will be broken by loss of cover and also by phone calls anyway.  A BES Push works very well if you are waiting for input from the Server, and I believe, has less impact on battery life.

Please use plain text.
New Developer
ennova2005
Posts: 96
Registered: ‎07-26-2008
My Device: Not Specified

Re: Cause of Local connection timed out after ~ 130000 ( TCP Socket )

Hi Peter

 

The issue is that we are seeing connections drop when connecting through BES but not BIS.

 

We do have a HB in our protocol.

 

I suspect the error we see follows a reconnect attempt after the connection was dropped, rather than when it is dropped. 

 

Is there a built in TCP Keep Alive parameter in Blackbery that we can control ?

 

(For various reasons, an always on  socket connection is desired. We understand it is not optimal and a different version of the application uses push + http but requires a proxy/middleware component that customers dont like )

 

Please use plain text.
New Developer
ennova2005
Posts: 96
Registered: ‎07-26-2008
My Device: Not Specified

Re: Cause of Local connection timed out after ~ 130000 ( TCP Socket )

Also, does a phone call interrupt active socket connections ?  I had, perhaps mistakenly,  assumed that in the Blackberry they did not..
Please use plain text.
BlackBerry Development Advisor
MSohm
Posts: 14,689
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook

Re: Cause of Local connection timed out after ~ 130000 ( TCP Socket )

The ConnectionTimeout parameter can be used to shorten the timeout, but not extend it beyond 2 minutes. 

 

How To - Control the connection timeout for TCP connections through BlackBerry Mobile Data System Connection Service
Article Number: DB-00526

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800563/How_To_...

 

In most cases, an incoming phone call will interrupt other data connections on the BlackBerry handheld.  Support for simultaneous phone and data connections can vary by carrier and location.  It is possible for a carrier to support this on some towers, but not others.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Developer
ennova2005
Posts: 96
Registered: ‎07-26-2008
My Device: Not Specified

Re: Cause of Local connection timed out after ~ 130000 ( TCP Socket )

 

For what this is worth  -we changed the timeout to 12 hours (yes) and now see our TCP connections through the BES/MDS stay on connected for longer that without it ..

 

Is there any chance that in the BES/MDS mode the  BES/MDS code uses this parameter for some other timeouts ? Like how long a TCP session is allowed to stay active?

 

Are there other settings on MDS recommended if the applicatios needs a persistent TCP connection ? For example, we have already increased the max KB/flow parameter.  What does the Allow Persistent Connection parameter do ? It appears that persistent connections seem to be allowed with or with out it.

 

Thanks Mark.

 

Please use plain text.
BlackBerry Development Advisor
MSohm
Posts: 14,689
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook

Re: Cause of Local connection timed out after ~ 130000 ( TCP Socket )

I recommend posting the BlackBerry Enterprise Server questions in the BlackBerry Enterprise Solution forum found here:  http://supportforums.blackberry.com/rim/board?board.id=BlackBerryEnterpriseSolution
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.