Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
marcelo #1
Member since Jul 2005 · 12 posts
Group memberships: Members
Show profile · Link to this post
Subject: message never reach destination user
Some time ago, I posted because I need to send messages to users from a service. The project was idle until now. So I am testing the library usage, using version 0.4.

I devised a very simple windows form app, ( to enter server, sender name and pass, destination name and body ).
All seems to run fine, but the message never arrives to destinee.

The relevant code is as follows

XmppClientConnection _connection = new XmppClientConnection( );
agsXMPP.Jid jidMe = new agsXMPP.Jid( txtSender.Text + "@" + txtServer.Text );
           
_connection.Server        = jidMe.Server;
_connection.Username    = jidMe.User;
_connection.Password    = txtPass.Text;
_connection.Resource    = "ultramini";
_connection.Priority    = 10;
_connection.Port        = 5222;

_connection.Open( );

string dest = txtTo.Text + "@" + txtServer.Text;

agsXMPP.Jid jidTo = new agsXMPP.Jid( dest );

agsXMPP.protocol.client.Message mess = new agsXMPP.protocol.client.Message( );

mess.From = jidMe;
mess.To   = jidTo;
mess.Body = txtMess.Text;

_connection.Send( mess );

_connection.Close( );
I captured the xml text from the message, as follows

"<message xmlns=\"jabber:client\" from=\"marcelo@develop\" to=\"administrator@develop\"><body>mess...</body></message>"

note the extra quotes, it comes from debugging

What may be wrong ?
How can I check the results from every relevant step ( Open( ), Send( ) )
Of course, both users are in the server ( they can chat interactively ), and the password for the sender is OK.
I'm using TIMP.NET as a server.
TIA
Marcelo

A
Avatar
Alex #2
Member since Feb 2003 · 4288 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Hi Marcelo,

the Open method is async. I assume your XMPP connection is not ready when you send your message. You should subscribe to the OnLogin event. This event gets raised when the connection is logged in and ready for sending stanzas. Some servers require to send your presence before they accept messages. So i would send your own presence in the OnLogin event. Take a look at the MiniClient sample, there should be everything you need.
I dont know much about the Tipic server, and never used it yet. Is your server public accessible for testing?

Alex
Avatar
marcelo #3
Member since Jul 2005 · 12 posts
Group memberships: Members
Show profile · Link to this post
Subject: thank you
Thank you.
In fact, I suspected that, and did the OnLogin suscription !!!
Just a minute ago, I was ready to reply my own post !!!
It's working fine now
Regarding TIMP.NET, my installation is not public, because it's intended ( now and for production purposes ) solely as a mean to inform users regarding some events from some services.
But you can download and install it. It's free up to 5 concurrent users, and the basic installation is pretty simple. Also, you can install it in any of your workstations.
Simply set the "domain" to the workstation name.
Also, set the authentication mode to ( don't remember the exact name ) the one which implies the password are stored as plaint text, in the xml user config.
That way, you can test also TIMP.
It does not require setpresence before you can send messages.
Avatar
marcelo #4
Member since Jul 2005 · 12 posts
Group memberships: Members
Show profile · Link to this post
Subject: yet another tip
Another tip I discovered ( useful for this kind of usage )
Set AutoRoster and AutoAgents to false before first connection.
Else, after the app send the messages, the library tries to get that info on behalf of the user, but the connection is closed, so it generates errors.
Avatar
Alex #5
Member since Feb 2003 · 4288 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
hi marcelo,

if you are not interested at the contact and agent-list then you don't need to request roster and agent. Setting AutoAgents and AutoRoster to false is correct then. But there should be no errors with this settings enabled.

Alex
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