Not logged in. · Lost password · Register
Forum: MatriX and XmppDotNet RSS
Avatar
tambunanw #1
User title: Welly
Member since Jul 2011 · 57 posts · Location: Jakarta
Group memberships: Members
Show profile · Link to this post
Subject: Can't Send Message to Component
i create xmpp component like this. i've already register the subdomain in OpenFire

  1.             XmppComponent component = new XmppComponent();
  2.             component.XmppDomain = "mediarelay@jakwt";
  3.             component.Hostname = "jakwt";
  4.             component.Password = "secret";
  5.             component.Port = 5275;
  6.            
  7.             component.OnReceiveXml += new EventHandler<Matrix.TextEventArgs>(component_OnReceiveXml);
  8.             component.OnPresence += new EventHandler<PresenceEventArgs>(component_OnPresence);
  9.             component.OnMessage += new EventHandler<MessageEventArgs>(component_OnMessage);
  10.             component.Open();
  11.             Console.ReadLine();

i'm trying to send message to component like this

  1.             xmppCon.Send(new Message { To = new Jid("welly@jakwt"), Body = "hai", Type = Matrix.Xmpp.MessageType.chat });

but the message is not arrived at the component...

could you please tell me what's wrong ?
Avatar
Alex #2
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
your XMPP domain includes an "@".

Components run on subdomains. When your server domain is jakwt then your component domain should be mediarelay.jakwt.
You have to send your messages to mediarelay.jakwt then.
This should solve your poblem.

Alex
Avatar
tambunanw #3
User title: Welly
Member since Jul 2011 · 57 posts · Location: Jakarta
Group memberships: Members
Show profile · Link to this post
Thanks Alex. It works.

The message is finally sent. But when my client login to open fire server. The component not receiving any presence.
Is that the correct behaviour ? So what's the difference between the XmppComponent and plain XmppClient than ?
Avatar
Alex #4
Member since Feb 2003 · 4449 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by tambunanw:
The message is finally sent. But when my client login to open fire server. The component not receiving any presence.
Is that the correct behaviour ?
This is correct, components gets no presence, see also http://xmpp.org/extensions/xep-0114.html

Quote by tambunanw:
So what's the difference between the XmppComponent and plain XmppClient than ?
The main difference is that a component is trusted, any many servers have special extensions for components, in this case you have access to server internas then.

If your server don't has such extensions, or you don't use them then the only difference is that a component is trusted. It makes no big difference then if you write a bot client or a component.

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: