Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Cyper #1
Member since Sep 2008 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: Open() Method Retry

I am making a presence client on a Smartphone using agsXMPP. If there is a socket error, I display a MessageBox on the phone telling the user there is a connection error and there are two options - Retry or Cancel.

If the user presses Retry, I just call my LogIn() function, which contains xmppCon.Open(). However, pressing this has never actually connected afterwards. I just continually get the socket error message. But if I quit the program and then restart, I can login as usual. My problem is not that I am getting a socket error, it's that Retry never seems to work. Is this because I need to have a timer and then try to reconnect after a certain amount of time has elapsed?

If the user presses Cancel, what should happen is nothing. However, what does happen is I get another socket error message, leading me to believe that the xmppCon.Open() method is trying to connect several times. What seems to happen is that it tries about 3 times to connect and then gives up. Even if I explicitly ask it to login again after the 3 times, it doesn't respond. Is there a way to change this? Or is this not supposed to be happening and it is something with my code?

Saying this, sometimes I also get many, many MessageBox messages saying there is a socket error (whether I press Retry or Cancel), and they appear very quickly (too quickly for me to close the program easily so sometimes I have to kill it). Surely this shouldn't be happening since I'm only asking the connection to be open once? Any ideas how can I prevent this?

Thanks for your help.
Jabberer #2
Member since Feb 2006 · 249 posts
Group memberships: Members
Show profile · Link to this post
the Open method should init only 1 connect in the socket class on smartphones. On desktop pc's you can have multiple if your server works with multiple SRV record entries. But SRV is not implemented in the CF.
Could you please try to debug your project with agsXMPP in debug mode and see what is causing the problems? Or can you write a small demo application which helps usto locate the cause the problem?
Are you running the latest code from SVN?
Software Developer
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: agsXMPP RSS