Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
anas.zgh #1
Member since Feb 2014 · 6 posts
Group memberships: Members
Show profile · Link to this post
Subject: How can i check if the xmpp session is still open
When i close the mobile app, i check the session on the xmpp server it still open, and there are packets waiting to be delivered ( when i open the app to recieve them ), but i re-login when the app starts, so how can i check if the session is still open ?? and get the active session ?? is that possible  ?
Avatar
Alex #2
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
if your app is not a location tracking or voice app then WIndows Phone totally terminates it when you go in background. It also closes the socket. Which means you should be always disconnected in this state.

In MatriX watch the OnClose and OnError events. When you get disconnected you always get the OnCLose event (sooner or later).

Alex
Avatar
anas.zgh #3
Member since Feb 2014 · 6 posts
Group memberships: Members
Show profile · Link to this post
I have a scheduled background worker, i believe that what keep my connection alive, i have waited for 10 seconds on background ( windows phone time span to snap my app ), and tried to completely close the application, in both cases the session is still on and available on the Xmpp server.
Avatar
Alex #4
Member since Feb 2003 · 4296 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
doesn't matter if you use a backgroundworker or not. After a given time (10sec) Windows Phone 7-8 terminates any running code in your app and closes the socket.
If your server still shows you alive then this is either a problem because of the IDE and emulator, or your server did not detect already that the socket died.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS