Examples of recipient()


Examples of net.tomp2p.message.Message.recipient()

              firewallTCP);
      message.sender(n1);
      //
      PeerAddress n2 = createAddress(idRecipient, inetRecipient, tcpPortRecipient, udpPortRecipient,
              firewallUDP, firewallTCP);
      message.recipient(n2);
      message.type(type);
      message.command(command);
      return message;
  }
View Full Code Here

Examples of net.tomp2p.message.Message.recipient()

      // this message is sent to the relay peer to initiate the rcon setup
      private Message createSetupMessage(final PeerAddress relayPeerAddress, final PeerAddress unreachablePeerAddress) {
        Message setUpMessage = new Message();
        setUpMessage.version(MESSAGE_VERSION);
        setUpMessage.sender(peer.peerAddress());
        setUpMessage.recipient(relayPeerAddress.changePeerId(unreachablePeerAddress.peerId()));
        setUpMessage.command(RPC.Commands.RCON.getNr());
        setUpMessage.type(Type.REQUEST_1);
        // setUpMessage.keepAlive(true);
        return setUpMessage;
      }
View Full Code Here

Examples of net.tomp2p.message.Message.recipient()

  @Override
  public FutureDone<Message> forwardToUnreachable(Message message) {
    // create temporal OK message
    final FutureDone<Message> futureDone = new FutureDone<Message>();
    final Message response = createResponseMessage(message, Type.PARTIALLY_OK);
    response.recipient(message.sender());
    response.sender(unreachablePeerAddress());

    try {
      buffer.addMessage(message, connectionBean().channelServer().channelServerConfiguration().signatureFactory());
    } catch (Exception e) {
View Full Code Here

Examples of net.tomp2p.message.Message.recipient()

    public static Message createResponseMessage(final Message requestMessage, final Type replyType, final PeerAddress peerAddress) {
        Message replyMessage = new Message();
        // this will have the ports > 40'000 that we need to know for sendig the reply
        replyMessage.senderSocket(requestMessage.senderSocket());
        replyMessage.recipientSocket(requestMessage.recipientSocket());
        replyMessage.recipient(requestMessage.sender());
        replyMessage.sender(peerAddress);
        replyMessage.command(requestMessage.command());
        replyMessage.type(replyType);
        replyMessage.version(requestMessage.version());
        replyMessage.messageId(requestMessage.messageId());
View Full Code Here

Examples of net.tomp2p.message.Message.recipient()

          @Override
          public void run() {
            semaphore.release();
           
            Message request = futureResponse.request();
            if(request.recipient().isSlow() && request.command() != Commands.PING.getNr() && request.command() != Commands.NEIGHBOR.getNr()) {
              // If the request goes to a slow peer, the channel can be closed until the response arrives
              LOG.debug("Ignoring channel close event because recipient is slow peer");
            } else {
              futureResponse.responseNow();
            }
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.