Package org.jivesoftware.smack

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


                // handle this how?
            }
        }


        connection.disconnect();

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

        
    }
View Full Code Here


      System.out.println("time..."+(stop-start));
         
         
          Thread.sleep(1000);
         
      connection.disconnect();
     
      Thread.sleep(10000);
      System.exit(0);
    } catch (XMPPException e) {
      System.out.println("error occured 1: "+e);
View Full Code Here

    isConnected = false;
    final XMPPConnection connectionToClose = connection;
    Runnable connectionCloseRunnable = new Runnable() {
      public void run() {
        try {
          connectionToClose.disconnect();
        } catch (RuntimeException e) {
          Tracing.logWarn("Error while trying to close instant messaging connection", e, InstantMessagingClient.class);
        }
      }
    };
View Full Code Here

                } catch (InterruptedException e) {
                    ;
                }
            }

            connection.disconnect();
        } catch (Throwable e) {
            try {
                Thread.sleep(120 * 1000);
            } catch (InterruptedException ie) {
                ;
View Full Code Here

                // handle this how?
            }
        }


        connection.disconnect();

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

        
    }
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

            Thread.sleep(1000);
          } catch (InterruptedException e) {
            log.debug("Sleep interrupted",e);
          }   
        }
        xmppConnection.disconnect();
      }

    } catch (XMPPException e) {
      log.error("Error occurred while sending the message : "+message.toXML(),e);
      handleException("Error occurred while sending the message : "+message.toXML(),e);
View Full Code Here

    } catch (XMPPException e) {
      log.error("Error occurred while sending the message : "+message.toXML(),e);
      handleException("Error occurred while sending the message : "+message.toXML(),e);
    }finally{
      if(!msgCtx.isServerSide()){
        xmppConnection.disconnect();
      }
    }
    } 
   
    /**
 
View Full Code Here

        localClient.sendPacket(msg);
//        remoteClient.sendPacket(msg);
       
       
        Thread.sleep(8000);
        remoteClient.disconnect();
        localClient.disconnect();
    }
   
}
View Full Code Here

            Thread.sleep(1000);
          } catch (InterruptedException e) {
            log.debug("Sleep interrupted",e);
          }   
        }
        xmppConnection.disconnect();
      }

    } catch (XMPPException e) {
      log.error("Error occurred while sending the message : "+message.toXML(),e);
      handleException("Error occurred while sending the message : "+message.toXML(),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.