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

Testing and Deployment

Reply
New Contributor
fabian_thrum
Posts: 4
Registered: ‎01-13-2012
My Device: 9780
My Carrier: O2
Accepted Solution

Connection stuck when connecting over BES/MDS

I have an application called MC Client (later referred as "client") which uses a socket connection in order to communicate with a Server, the Mobile Controller (later referred as "controller").
The connection is used to exchange signaling information for call control, instant messaging and presence information and uses the SIP protocol.
There are two ways how I can connect the Client to the Controller:
-Direct TCP (with a configured APN)
-WIFI
-BES/MDS

While first two modes work quite smooth we are facing some issues with the connection method over the MDS service.

The client itself uses the parameter deviceside=false to initiate the socket connection via the MDS server.
We did several traces on controller and client, and have the impression that the TCP stream is somehow blocked on the BES between the client and controller.


Following things we find out so far:
- The TCP connection handshake works very quickly. SYN,SYNACK,ACK handshake is performed always quick.
- The data channel itself seems to block / delay the data.
Initially the application did not send data to the socket, only after some data was sent initially from the controller side before. I worked around this by sending a single data packet into the stream with some dummy data "\r\n" from the controller to the client directly after the connection establishment.
That way a steam is usable by the client immediately, however after two messages the stream seems to block again.


I`m using Windows Server 2007 SP2 64 bit with BlackBerry® Enterprise Server Express and BlackBerry MDS Connection Service version: 5.0.1.39


Scenario Description:
[13:40:21.737] Client sends first data Packet "REGISTER"
- Packet is received on controller and replied with "401 Unauthorized" immediately after 15,8 msec (see packet trace)
[13:40:25.619] Client receives the "401 Unauthorized"
- Packet is delivered a bit late, but still in time (after 3,8 seconds)
[13:40:26.054] Client sends REGISTER with the authorization response
- the second packet never reaches the controller, the connection timed out


The BES server itself seems to be functional, since other applications like Email or the Rove SSH client seem to work well.

-Is there any way to influence the BES server how the packets for an MDS socket connection are forwarded? Is there some proper way to troubleshoot this on the BES server?
I look into the logs, the most information I can find there the a connection is opened and closed again.



Any hints?

Please use plain text.
Administrator
MSohm
Posts: 14,281
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Connection stuck when connecting over BES/MDS

Is there a proxy server between the BES and your controller?  Could you give this sample application a try and let me know if it works.

 

Implement basic HTTP authentication

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 Contributor
fabian_thrum
Posts: 4
Registered: ‎01-13-2012
My Device: 9780
My Carrier: O2

Re: Connection stuck when connecting over BES/MDS

Hello Mark,

There is no proxy server, transparent proxy server or packet filter between the BES and the controller. The client is using a socket connection for this:
socket://10.10.25.124:5062;DeviceSide=false

Thanks,
Fabian
Please use plain text.
New Contributor
fabian_thrum
Posts: 4
Registered: ‎01-13-2012
My Device: 9780
My Carrier: O2

Re: Connection stuck when connecting over BES/MDS

I finaly found a solution for this.

We modified the client application to do a flush() after writing to the stream object.

Looks like that there is a mayor difference how the steam object of a socket behaves.

With direct TCP and WIFI all data is send imediately, while with the MDS connection everything gots queued for seconds until a flush() is made.

 

So remember: when using socket connection via MDS allways do flush when using time critical data communication.

 

 

 

 

Please use plain text.