Package net.tomp2p.futures

Examples of net.tomp2p.futures.FutureDirect.awaitUninterruptibly()


            Assert.assertEquals(1, ccohTCP.total());

            Thread.sleep(7000);

            FutureDirect fd2 = sender.sendDirect(peerConnection).object("test").start();
            fd2.awaitUninterruptibly();
            peerConnection.close().await();
            Assert.assertEquals(2, ccohTCP.total());
            System.out.println("done");
        } finally {
            if (sender != null) {
View Full Code Here


          System.out.println("request [" + request + "]");
          return "world";
        }
      });
      FutureDirect futureData = p1.sendDirect(p2.peerAddress()).object("hello").start();
      futureData.awaitUninterruptibly();
      System.out.println("reply [" + futureData.object() + "]");
    } finally {
      if (p1 != null) {
        p1.shutdown().await();
      }
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.