Package net.tomp2p.futures

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


    SimpleChannelInboundHandler<Message> rconInboundHandler = new SimpleChannelInboundHandler<Message>() {
      @Override
      protected void channelRead0(ChannelHandlerContext ctx, Message msg) throws Exception {
        if(msg.command() == Commands.RCON.getNr() && msg.type() == Type.OK) {
          LOG.debug("Successfully set up the reverse connection to peer {}", message.recipient().peerId());
          rconResponse.response(msg);
        } else {
          LOG.debug("Could not acquire a reverse connection to peer {}", message.recipient().peerId());
          rconResponse.failed("Could not acquire a reverse connection");
          futureResponse.failed(rconResponse.failedReason());
        }
View Full Code Here


      // only the case when a unreachable peer makes a request to another slow, unreachable peer
      Map<Integer, FutureResponse> pendingRequests = dispatcher().getPendingRequests();
      FutureResponse pendingRequest = pendingRequests.remove(realMessage.messageId());
      if (pendingRequest != null) {
        // we waited for this response, answer it
        pendingRequest.response(realMessage);

        // send ok, not fire and forget - style
        LOG.debug("Successfully answered pending request {} with {}", pendingRequest.request(), realMessage);
        responder.response(createResponseMessage(message, Type.OK, message.recipient()));
      } else {
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.