Package org.jivesoftware.smack

Examples of org.jivesoftware.smack.XMPPConnection.sendPacket()


    XMPPConnection conn0 = getConnection(0);
    XMPPConnection conn1 = getConnection(1);

    // Send a message as the last activity action from connection 1 to
    // connection 0
    conn1.sendPacket(new Message(getBareJID(0)));

    // Wait 1 seconds to have some idle time
    try {
      Thread.sleep(1000);
    } catch (InterruptedException e) {
View Full Code Here


    XMPPConnection conn0 = getConnection(0);
    XMPPConnection conn2 = getConnection(2);

    // Send a message as the last activity action from connection 2 to
    // connection 0
    conn2.sendPacket(new Message(getBareJID(0)));

    // Wait 1 seconds to have some idle time
    try {
      Thread.sleep(1000);
    } catch (InterruptedException e) {
View Full Code Here

                log.info("Logging in anonymously to XMPP on connection: " + connection);
                connection.loginAnonymously();
            }

            // now lets send a presence
            connection.sendPacket(new Presence(Presence.Type.AVAILABLE));
        }
        return connection;
    }
   
  public boolean isSingleton() {
View Full Code Here

                LOG.info("Logging in anonymously to XMPP on connection: " + connection);
                connection.loginAnonymously();
            }

            // now lets send a presence
            connection.sendPacket(new Presence(Presence.Type.AVAILABLE));
        }
        return connection;
    }

    public boolean isSingleton() {
View Full Code Here

        try{
            connection.login(user, password);
            System.out.println("Logged in as " + connection.getUser());
            Presence presence = new Presence(Presence.Type.available);
            connection.sendPacket(presence);

        } catch (XMPPException ex){
            Logger.getLogger(JabberWorkItemHandler.class.getName()).log(Level.SEVERE, null, ex);
            System.out.println("Failed to log in as " + connection.getUser());
            System.exit(1);
View Full Code Here

                    JingleIQ.generateSID(),
                    contentList );
               
                System.out.println( "CALLER: sending jingle request: " + sessionInitIQ.toXML() );
               
                connection.sendPacket(sessionInitIQ);
         
                // now hang out until the user requests that we exit.
                // The rest of the call will be handled by the CallerJingleSession we created above.
          log( CALLER, "Waiting..." );
          while( running ) {
View Full Code Here

    XMPPConnection conn0 = getConnection(0);
    XMPPConnection conn1 = getConnection(1);

    // Send a message as the last activity action from connection 1 to
    // connection 0
    conn1.sendPacket(new Message(getBareJID(0)));

    // Wait 1 seconds to have some idle time
    try {
      Thread.sleep(1000);
    } catch (InterruptedException e) {
View Full Code Here

    XMPPConnection conn0 = getConnection(0);
    XMPPConnection conn2 = getConnection(2);

    // Send a message as the last activity action from connection 2 to
    // connection 0
    conn2.sendPacket(new Message(getBareJID(0)));

    // Wait 1 seconds to have some idle time
    try {
      Thread.sleep(1000);
    } catch (InterruptedException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.