Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 7th, 2013  |  syntax: Java  |  size: 0.57 KB  |  views: 219  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.     private void keepTrying(final Bootstrap b) {
  2.         b.connect().addListener(new ChannelFutureListener() {
  3.             @Override
  4.             public void operationComplete(ChannelFuture cf) throws Exception {
  5.                 if(cf.isSuccess()) {
  6.                     System.out.println("Connected successfully");
  7.                 } else {
  8.                     Thread.sleep(10*1000);
  9.                     System.out.println("connection attempt failed, econnecting");
  10.                     b.connect().addListener(this);
  11.                 }
  12.             }
  13.         });
  14.     }