Package net.tomp2p.futures

Examples of net.tomp2p.futures.FutureResponse.addListener()


                              }
                            }
            });
                        FutureResponse fr2 = peer.pingRPC().pingUDPProbe(peerAddress, cc,
                                configuration);
                        fr2.addListener(new BaseFutureAdapter<FutureResponse>() {
              @Override
                            public void operationComplete(FutureResponse future) throws Exception {
                              if(future.isFailed()) {
                                LOG.warn("FutureDiscover (2): UDP failed connection", future);
                              }
View Full Code Here


        return send(message, configuration, channelCreator);
    }
   
    private FutureResponse send(final Message message, final ConnectionConfiguration configuration, final ChannelCreator channelCreator) {
      FutureResponse futureResponse = new FutureResponse(message);
      futureResponse.addListener(new BaseFutureAdapter<FutureResponse>() {
      @Override
            public void operationComplete(FutureResponse future) throws Exception {
              if(future.isSuccess()) {
                Message response = future.responseMessage();
                if(response != null) {
View Full Code Here

            // send the message to the relay so it forwards it to the unreachable peer
            FutureResponse futureResponse = RelayUtils.send(peerConnection, peer.peerBean(),
                peer.connectionBean(), config, setUpMessage);

            // wait for the unreachable peer to answer
            futureResponse.addListener(new BaseFutureAdapter<FutureResponse>() {
              @Override
              public void operationComplete(FutureResponse future) throws Exception {
                // get the PeerConnection which is cached in the PeerBean object
                final PeerConnection openPeerConnection = peer.peerBean().peerConnection(unreachablePeerAddress.peerId());
                if (openPeerConnection != null && openPeerConnection.isOpen()) {
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.