Package org.jivesoftware.smack

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


          log( RECEIVER, "connecting to " + host );
         
          // connect to host (don't log in yet)
          ConnectionConfiguration config = new ConnectionConfiguration(host);
          XMPPConnection connection = new XMPPConnection( config );
          connection.connect();
          // setup service discovery and entity capabilities.
          // this ensures that other software, such as Jitsi, knows that we support
          // ice and so on
          //ServiceDiscoveryManager.setIdentityName("Java Bells");
          ServiceDiscoveryManager disco = ServiceDiscoveryManager.getInstanceFor(connection);
View Full Code Here


        try {
          log( CALLER, "connecting to " + host );

          // connect to the XMPP server. Don't log in yet.
          XMPPConnection connection = new XMPPConnection( host );
          connection.connect();

          // derive stun and turn server addresses from the connection:
          StunTurnAddress sta = StunTurnAddress.getAddress( connection );
          // create an ice agent using the stun/turn address. We will need this to figure out
          // how to connect our clients:
View Full Code Here

        password = (samePassword ? passwordPrefix : passwordPrefix + (connectionIndex + 1));

      XMPPConnection con = getConnection(connectionIndex);
     
      if (!con.isConnected())
        con.connect();
      try {
          con.login(usernamePrefix + (connectionIndex + 1), password, "Smack");
      } catch (XMPPException e) {
          createAccount(connectionIndex, usernamePrefix + (connectionIndex + 1), password);
            con.login(usernamePrefix + (connectionIndex + 1), password, "Smack");
View Full Code Here

          {
                try {
                    // If not connected, connect so that we can delete the account.
                    if (!getConnection(i).isConnected()) {
                        XMPPConnection con = getConnection(i);
                        con.connect();
                        con.login(getUsername(i), getUsername(i));
                    }
                    else if (!getConnection(i).isAuthenticated()) {
                        getConnection(i).login(getUsername(i), getUsername(i));    
                    }
View Full Code Here

        try {
            // Anonymous user joins the new room
            ConnectionConfiguration connectionConfiguration =
                    new ConnectionConfiguration(getHost(), getPort(), getServiceName());
            XMPPConnection anonConnection = new XMPPConnection(connectionConfiguration);
            anonConnection.connect();
            anonConnection.loginAnonymously();
            MultiUserChat muc2 = new MultiUserChat(anonConnection, room);
            muc2.join("testbot2");
            Thread.sleep(400);
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.