Quantcast
Channel: Ignite Realtime : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 10742

iqRouter not sending ping

$
0
0

Hi, im trying to make a plugin that will send an IQ ping to the connected clients. However, when I execute it, client receive nothing. Any idea why ? below is my code and thanks in advanced!

 

   public void sendMessage(String from, String to) {

      final Message message = new Message();

      final XMPPServer xmppServer = XMPPServer.getInstance();

      JID toAddress = new JID(to+"@"+serverName);

      JID fromAddress = new JID(from+"@"+serverName);

     

      //message.setTo(toAddress);

      //message.setFrom(fromAddress);

      //message.setSubject(getSubject());

      //message.setBody(getMessage());

     

      // For testing purpose

      IQRouter iqRouter = XMPPServer.getInstance().getIQRouter();

      IQ iq = new IQ();

      iq.setTo(toAddress);

      iq.setFrom(fromAddress);

      iq.setType(IQ.Type.get);

      iq.setChildElement("ping","urn:xmpp:ping");

 

      iqRouter.route(iq);

     

      //router.route(message);

   }


Viewing all articles
Browse latest Browse all 10742

Trending Articles