Guest User

Untitled

a guest
May 6th, 2015
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. public static void main(final String[] args)
  2. {
  3. Client cl1 = new Client("cl1");
  4. cl1.initializeComponents();
  5.  
  6. Client cl2 = new Client("cl2");
  7. cl2.initializeComponents();
  8.  
  9. for (int i = 0; i < 10; i++){
  10. try {
  11.  
  12. Date date = new Date();
  13. String formattedDate = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss").format(date);
  14.  
  15. cl1.sendMessage(formattedDate + " number of iteration " + i);
  16. Thread.sleep(2000);
  17.  
  18. } catch (InterruptedException e) {
  19. // TODO Auto-generated catch block
  20. e.printStackTrace();
  21. }
  22.  
  23. }
  24.  
  25. cl1.cleanUpConnection();
  26. cl2.cleanUpConnection();
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment