Package net.tomp2p.futures

Examples of net.tomp2p.futures.FutureSend


    HybridEncryptedContent encryptedMessage = signAndEncryptMessage(message, targetPublicKey);
    if (encryptedMessage == null)
      return false;

    // send message to the peer which is responsible for the given key
    FutureSend futureSend = networkManager.getConnection().getPeer()
        .send(Number160.createHash(message.getTargetKey())).setObject(encryptedMessage)
        .setRequestP2PConfiguration(createSendingConfiguration()).start();

    // attach a future listener to log, handle and notify events
    FutureRoutedListener listener = new FutureRoutedListener(message, targetPublicKey, this);
    futureSend.addListener(listener);
    boolean success = listener.await();

    if (success) {
      logger.debug("Message sent. Target key = '{}', Message ID = '{}'.",
          message.getTargetKey(), message.getMessageID());
View Full Code Here

TOP

Related Classes of net.tomp2p.futures.FutureSend

Copyright © 2018 www.massapicom. 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.