Examples of sender()


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

   */
  public static Message decodeRelayedMessage(Buffer buf, InetSocketAddress recipient, InetSocketAddress sender,
      SignatureFactory signatureFactory) throws InvalidKeyException, NoSuchAlgorithmException,
      InvalidKeySpecException, SignatureException, IOException {
    Message decodedMessage = decodeMessage(buf, recipient, sender, signatureFactory);
    boolean isRelay = decodedMessage.sender().isRelayed();
    if (isRelay && !decodedMessage.peerSocketAddresses().isEmpty()) {
      PeerAddress tmpSender = decodedMessage.sender().changePeerSocketAddresses(decodedMessage.peerSocketAddresses());
      decodedMessage.sender(tmpSender);
    }
    return decodedMessage;
View Full Code Here

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

      SignatureFactory signatureFactory) throws InvalidKeyException, NoSuchAlgorithmException,
      InvalidKeySpecException, SignatureException, IOException {
    Message decodedMessage = decodeMessage(buf, recipient, sender, signatureFactory);
    boolean isRelay = decodedMessage.sender().isRelayed();
    if (isRelay && !decodedMessage.peerSocketAddresses().isEmpty()) {
      PeerAddress tmpSender = decodedMessage.sender().changePeerSocketAddresses(decodedMessage.peerSocketAddresses());
      decodedMessage.sender(tmpSender);
    }
    return decodedMessage;
  }
 
View Full Code Here

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

      InvalidKeySpecException, SignatureException, IOException {
    Message decodedMessage = decodeMessage(buf, recipient, sender, signatureFactory);
    boolean isRelay = decodedMessage.sender().isRelayed();
    if (isRelay && !decodedMessage.peerSocketAddresses().isEmpty()) {
      PeerAddress tmpSender = decodedMessage.sender().changePeerSocketAddresses(decodedMessage.peerSocketAddresses());
      decodedMessage.sender(tmpSender);
    }
    return decodedMessage;
  }
 
  /**
 
View Full Code Here

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

          int udpPortRecipient, byte command, Type type, boolean firewallUDP, boolean firewallTCP)
          throws UnknownHostException {
      Message message = new Message();
      PeerAddress n1 = createAddress(idSender, inetSender, tcpPortSender, udpPortSender, firewallUDP,
              firewallTCP);
      message.sender(n1);
      //
      PeerAddress n2 = createAddress(idRecipient, inetRecipient, tcpPortRecipient, udpPortRecipient,
              firewallUDP, firewallTCP);
      message.recipient(n2);
      message.type(type);
View Full Code Here

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

            @Override
            public void operationComplete(final FutureForkJoin<FutureResponse> future) throws Exception {
                final boolean finished;
                if (future.isSuccess()) {
                    Message lastResponse = future.last().responseMessage();
                    PeerAddress remotePeer = lastResponse.sender();
                    routingMechanism.addPotentialHits(remotePeer);
                    Collection<PeerAddress> newNeighbors = lastResponse.neighborsSet(0).neighbors();

                    Integer resultSize = lastResponse.intAt(0);
                    Number160 keyDigest = lastResponse.key(0);
View Full Code Here

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

                  NeighborSet ns = response.neighborsSet(0);
                  if(ns!=null) {
                    for(PeerAddress neighbors:ns.neighbors()) {
                      synchronized (peerBean().peerStatusListeners()) {
                        for (PeerStatusListener peerStatusListener : peerBean().peerStatusListeners()) {
                          peerStatusListener.peerFound(neighbors, response.sender(), null);
                        }
                      }
                    }
                  }
                }
View Full Code Here

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

        peers = UtilsTracker.limit(peers, TrackerRPC.MAX_MSG_SIZE_UDP);

        message.key(key.locationKey());
        message.key(key.domainKey());
       
    LOG.debug("sent ({}) to {} / {}", message.sender().peerId(), remotePeer.peerId(), peers.size());
    message.trackerData(peers);
    FutureResponse futureResponse = new FutureResponse(message);
    final RequestHandler<FutureResponse> requestHandler = new RequestHandler<FutureResponse>(futureResponse,
            peerBean(), connectionBean(), connectionConfiguration);
    if (!connectionConfiguration.isForceTCP()) {
View Full Code Here

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

      // 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.sender()

  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) {
      LOG.error("Cannot encode the message", e);
View Full Code Here

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

        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());
        replyMessage.udp(requestMessage.isUdp());
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.