01-13-2012 09:23 AM
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)
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: 18.104.22.168
[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.
Solved! Go to Solution.
01-16-2012 10:18 AM
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.
01-16-2012 11:25 AM
01-19-2012 10:29 AM
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.