Package org.jivesoftware.smack

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


    boolean test = false;
    Connection conn = new XMPPConnection(server);
    try {
      conn.connect();
      conn.login(uid, pwd);
      conn.disconnect();
      test = true;
    } catch (XMPPException e) {
      logger.l2("XMPP connection test failed", e);
    }
    return test;
View Full Code Here


            for (int i = 0; i < 10; i++) {
                LOG.info("Sending message: " + i);
                chat.sendMessage("Hello from Message: " + i);
            }
            LOG.info("Sent all messages!");
            con.disconnect();
        } catch (XMPPException e) {
            if (block) {
                LOG.info("Caught: " + e);
                e.printStackTrace();
            } else {
View Full Code Here

  }

  final static synchronized  void closeConnection( long connectionHandle )
  {
    XMPPConnection connection = connections.get( connectionHandle );
    connection.disconnect();
    connections.remove( new Long( connectionHandle ) ) ;
  }
 
 
  final static Chat retrieveChat(long chatHandle )
View Full Code Here

            for (int i = 0; i < 10; i++) {
                System.out.println("Sending message: " + i);
                chat.sendMessage("Hello from Message: " + i);
            }
            System.out.println("Sent all messages!");
            con.disconnect();
        } catch (XMPPException e) {
            if (block) {
                System.out.println("Caught: " + e);
                e.printStackTrace();
            } else {
View Full Code Here

      }
     
    });
    //mt.track();

    connection.disconnect();
  }
}
View Full Code Here

                // handle this how?
            }
        }


        connection.disconnect();

        manager.completeWorkItem(workItem.getId(), null);

        
    }
View Full Code Here

              try {
                wait(1000);
              } catch (InterruptedException e) {}
            }
          }
          connection.disconnect();
          log( RECEIVER, "Done. Exiting thread." );
        } catch ( Exception e ) {
          System.out.println( RECEIVER + ": " + e );
          e.printStackTrace();
          System.exit(1);
View Full Code Here

              try {
                wait(1000);
              } catch (InterruptedException e) {}
            }
          }
          connection.disconnect();
          log( CALLER, "Done. Exiting thread." );
        } catch ( Exception e ) {
          System.out.println( CALLER + ": " + e );
          e.printStackTrace();
          System.exit(1);
View Full Code Here

                "Presence mode of user2 is wrong",
                presence.getMode() == null || presence.getMode() == Presence.Mode.available);

            // Anonymous user leaves the room
            muc2.leave();
            anonConnection.disconnect();
            Thread.sleep(250);
            // User1 checks the presence of Anonymous user in the room
            presence = muc.getOccupantPresence(room + "/testbot2");
            assertNull("Presence of participant testbotII still exists", presence);
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.