[jdev] Using XMPP to talk to a mobile client

Simon Tennant simon at buddycloud.com
Fri Apr 10 08:11:11 CDT 2009


Mobile is tricky: you fire off a stanza just as you enter a tunnel with
no coverage and your client is none the wiser as to whether the stanza
actually made it to the server. Indeed your GPRS or 3G connection may
even stay connected.

We have also had good success on the mobile by using sockets rather than
BOSH in the Buddycloud client. 

There are a couple of tricks that we used to ensure we loose no messages:

    * On mobile networks the phone client may be pushing off messages
      into a socket that has lost cellular coverage.  If you have a
      large sliding window on the TCP layer, these messages are lost.
      Twiddling your TCP stack can help keep the number of packets
      between ACKs low.
    * We have worked around these by using message archiving (XEP-0136)
      and re-requesting messages slightly before the device lost connection.
    * "warm starting".  In a bouncy environment having to pull down the
      roster, PEP and pub-sub subscriptions each time will get
      expensive.  If a session can be recovered, recover, and keep on going.

The real solution will be implementing XEP-0198: Stream Management and
managing acknowledged stanzas at the application layer. This is
something that we plan on implementing to handle the unpredictable
mobile environment.

S.

Alexander Gnauck wrote:
> Mridul Muralidharan wrote:
>   
>> Just to mention, BOSH does not have any same client IP requirement/restriction.
>>
>> And unlike tcp binding of xmpp - where session is terminated if disconnected, BOSH does handle disconnects in its design.
>>
>> The only requirements would be -
>>
>> a) ability of the client to connect back before the session/idle timeout.
>> b) BOSH gateway not going down.
>> c) BOSH client not going down.
>>
>> b and c are mentioned - so that the session state (rid, etc) is not lost.
>>     
>
> I have a much better experience with sockets on Mobile devices than with 
> BOSH. Of course this also depends how reliable you Mobile network is, 
> but in Europe its very good, and sockets works very well.
>
> Regards,
> Alex
> --
> Alexander Gnauck
> http://www.ag-software.de
> xmpp:gnauck at jabber.org
>
> _______________________________________________
> JDev mailing list
> Forum: http://www.jabberforum.org/forumdisplay.php?f=20
> Info: http://mail.jabber.org/mailman/listinfo/jdev
> Unsubscribe: JDev-unsubscribe at jabber.org
> _______________________________________________
>
>
>   


-- 
Simon Tennant
Buddycloud
uk: +44 20 7043 6756               de: +49 89 420 955 854  
uk: +44 78 5335 6047               de: +49 17 8545 0880
email and xmpp: simon at buddycloud.com
http://buddycloud.com




More information about the JDev mailing list