Subject: Close / Reconnnect Problems with StartTLS = True
Using Matrix DLL 1.2.1.1, WinMo 6, Professional Emulator
I get a variation of problems resembling either an emulator hang, a debugger disconnect, or an emulator crash frequently when I call xmppClient.Open following a previously called xmppClient.Close. It is not consistent, but it is repeatable after a few tries (usually 2-10). The easiest repeatable test I've produced was simply calling xmppClient.Open inside the OnClose event in the provided mobile sample client. Thus I use sample client's GUI to disconnect myself, which causes the client to reconnect via the xmppClient.Open call in OnClose. Repeating this sequence a few times will reproduce one of the above variations (crash, hang, etc).
This problematic behavior occurs specifically with StartTLS = true, I have no issues doing the above test case with StartTls disabled. I've seen this same behavior on my prototype app, on hardware as well as emulator (StartTLS = true leads to issues on frequent reconnects; these reconnects usually have at least 10 seconds in between their corresponding Close and Open calls; StartTLS = false leads to no issues).
I've piped the XML to Studio's debug output and this is consistently the last messages prior to an emulator/debugger/various crash:
As a final note, I've also implemented this same test situation in the desktop client and encountered no problems there. Seems to be specifically an issue with the TLS component on the mobile version.
I get a variation of problems resembling either an emulator hang, a debugger disconnect, or an emulator crash frequently when I call xmppClient.Open following a previously called xmppClient.Close. It is not consistent, but it is repeatable after a few tries (usually 2-10). The easiest repeatable test I've produced was simply calling xmppClient.Open inside the OnClose event in the provided mobile sample client. Thus I use sample client's GUI to disconnect myself, which causes the client to reconnect via the xmppClient.Open call in OnClose. Repeating this sequence a few times will reproduce one of the above variations (crash, hang, etc).
This problematic behavior occurs specifically with StartTLS = true, I have no issues doing the above test case with StartTls disabled. I've seen this same behavior on my prototype app, on hardware as well as emulator (StartTLS = true leads to issues on frequent reconnects; these reconnects usually have at least 10 seconds in between their corresponding Close and Open calls; StartTLS = false leads to no issues).
I've piped the XML to Studio's debug output and this is consistently the last messages prior to an emulator/debugger/various crash:
i -> 3
OnClose Event Fired, calling xmppClient.Open()
SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="folka" version="1.0" >
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="folka" id="aadf23d0" lang="en" version="1.0" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
<mechanism>PLAIN</mechanism>
<mechanism>ANONYMOUS</mechanism>
</mechanisms>
<compression xmlns="http://jabber.org/features/compress">
<method>zlib</method>
</compression>
<auth xmlns="http://jabber.org/features/iq-auth" />
<register xmlns="http://jabber.org/features/iq-register" />
</stream:features>
SEND: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
The program '[0xB6AF91D2] MiniClientWM.exe: Managed' has exited with code 0 (0x0).
OnClose Event Fired, calling xmppClient.Open()
SEND: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" to="folka" version="1.0" >
RECV: <stream:stream xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client" from="folka" id="aadf23d0" lang="en" version="1.0" >
RECV: <stream:features xmlns:stream="http://etherx.jabber.org/streams">
<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
<mechanism>PLAIN</mechanism>
<mechanism>ANONYMOUS</mechanism>
</mechanisms>
<compression xmlns="http://jabber.org/features/compress">
<method>zlib</method>
</compression>
<auth xmlns="http://jabber.org/features/iq-auth" />
<register xmlns="http://jabber.org/features/iq-register" />
</stream:features>
SEND: <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
The program '[0xB6AF91D2] MiniClientWM.exe: Managed' has exited with code 0 (0x0).
As a final note, I've also implemented this same test situation in the desktop client and encountered no problems there. Seems to be specifically an issue with the TLS component on the mobile version.
This post was edited on 2010-04-21, 22:46 by Jro.