Not logged in. · Lost password · Register
Forum: agsXMPP SDK Support RSS
Avatar
jcdekoning #1
Member since Sep 2005 · 13 posts
Group memberships: Members
Show profile · Link to this post
Subject: NullReferenceException with CompactFramework
Back again. For my application i don't know for sure if there is a connection available. Therefore messages are stored in a local queue. Everytime a message is created and should be send, my application tries to connect to a server. If loggin in is possible the local stored messages are send to the server.

This is working on a desktop pc. When i use the Open method of XmppClientConnection and a connection can be created there is no problem when sending messages to the server. When no connection is available and i do the Open method for a second time i get a NullReferenceException.

I now try to change the code so it will create a new XMPPClientConnection every time. But the strange thing is that it just work on a desktop pc.
Avatar
Alex #2
Member since Feb 2003 · 4246 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi,

You get the OnLogin Event when you get authenticated (XMPP Connect).
And you get the OnClose event when the connection is lost or closed.
So use a boolean value to store this state.
There are some improvements in the latest code. So you could also try to download the latest code from SVN.

Alex
Alexander Gnauck
AG-Software
Avatar
jcdekoning #3
Member since Sep 2005 · 13 posts
Group memberships: Members
Show profile · Link to this post
Okey i will try the latest code.

I think the error has nothing to do with login and close event. When i repeat the Open() method for example twice the problem occured. Using a boolean cannot fix this problem i think.
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 SDK Support RSS