Examples of peerSocketAddresses()


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

    message.recipient(receiver);
    message.recipientSocket(receiver.createSocketTCP());
   
    Buffer encoded = RelayUtils.encodeMessage(message, signature);
    Message decoded = RelayUtils.decodeMessage(encoded, message.recipientSocket(), message.senderSocket(), signature);
    Assert.assertEquals(message.peerSocketAddresses().size(), decoded.peerSocketAddresses().size());
  }
 
  @Test
  public void testEncodeDecodeString() {
    String test = "dummy";
View Full Code Here

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

    envelope.keepAlive(true);

    // this will be read RelayRPC.handlePiggyBackMessage
    Collection<PeerSocketAddress> peerSocketAddresses = new ArrayList<PeerSocketAddress>(1);
    peerSocketAddresses.add(new PeerSocketAddress(message.sender().inetAddress(), 0, 0));
    envelope.peerSocketAddresses(peerSocketAddresses);
   
    // holds the message that will be returned to he requester
    final FutureDone<Message> futureDone = new FutureDone<Message>();

    // Forward a message through the open peer connection to the unreachable peer.
View Full Code Here

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

  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.peerSocketAddresses()

      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
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.