Advertisement
Guest User

Untitled

a guest
Mar 7th, 2013
516
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  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.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement