Examples of recipient()


Examples of io.netty.channel.socket.DatagramPacket.recipient()

                    return msg;
                }
            }
            // We can only handle direct buffers so we need to copy if a non direct is
            // passed to write.
            return new DatagramPacket(newDirectBuffer(packet, content), packet.recipient());
        }

        if (msg instanceof ByteBuf) {
            ByteBuf buf = (ByteBuf) msg;
            if (!buf.hasMemoryAddress() && (PlatformDependent.hasUnsafe() || !buf.isDirect())) {
View Full Code Here

Examples of io.netty.channel.socket.DatagramPacket.recipient()

            DatagramPacket p = (DatagramPacket) msg;
            ByteBuf content = p.content();
            if (isSingleDirectBuffer(content)) {
                return p;
            }
            return new DatagramPacket(newDirectBuffer(p, content), p.recipient());
        }

        if (msg instanceof ByteBuf) {
            ByteBuf buf = (ByteBuf) msg;
            if (isSingleDirectBuffer(buf)) {
View Full Code Here

Examples of io.netty.channel.socket.DatagramPacket.recipient()

                return msg;
            }

            // We can only handle direct buffers so we need to copy if a non direct is
            // passed to write.
            return new DatagramPacket(newDirectBuffer(packet, content), packet.recipient());
        }

        if (msg instanceof ByteBuf) {
            ByteBuf buf = (ByteBuf) msg;
            if (buf.hasMemoryAddress()) {
View Full Code Here

Examples of io.netty.channel.socket.DatagramPacket.recipient()

        final DatagramPacket d = (DatagramPacket) msg;
        LOG.debug("got UDP message {}", d);
        final ByteBuf buf = d.content();
        final InetSocketAddress sender = d.sender();
        final InetSocketAddress recipient = d.recipient();

        try {
            Decoder decoder = new Decoder(signatureFactory);
            boolean finished = decoder.decode(ctx, buf, recipient, sender);
            if (finished) {
View Full Code Here

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

    // peer will close the PeerConnection to the unreachable peer.
    rconMessage.keepAlive(true);
    // making the message ready to send
    PeerAddress recipient = message.recipient().changeAddress(socketAddress.inetAddress())
            .changePorts(socketAddress.tcpPort(), socketAddress.udpPort()).changeRelayed(false);
    rconMessage.recipient(recipient);
    rconMessage.command(RPC.Commands.RCON.getNr());
    rconMessage.type(Message.Type.REQUEST_1);
    return rconMessage;
  }
View Full Code Here

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

    Message message = new Message();
    message.command(Commands.values()[rnd.nextInt(Commands.values().length)].getNr());
    message.type(Type.values()[rnd.nextInt(Type.values().length)]);
    message.recipientSocket(new InetSocketAddress(0));
    message.recipient(new PeerAddress(new Number160(rnd), message.recipientSocket()));
    message.senderSocket(new InetSocketAddress(0));
    message.sender(new PeerAddress(new Number160(rnd), message.senderSocket()));
    return message;
  }
}
View Full Code Here

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

        .changeFirewalledTCP(true).changeFirewalledUDP(true);
    message.sender(sender);
    message.senderSocket(sender.createSocketTCP());
   
    PeerAddress receiver = UtilsNAT.createAddress();
    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());
View Full Code Here

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

                firewallTCP);
        message.sender(n1);
        //
        PeerAddress n2 = createAddress(idRecipien, 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()

                firewallTCP);
        message.sender(n1);
        //
        PeerAddress n2 = createAddress(idRecipien, 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()

        LOG.debug("Successfully answered pending request {} with {}", pendingRequest.request(), realMessage);
        responder.response(createResponseMessage(message, Type.OK, message.recipient()));
      } else {
        // handle Relayed <--> Relayed.
        // This could be a pending message for one of the relayed peers, not for this peer
        BaseRelayForwarderRPC forwarder = forwarders.get(realMessage.recipient().peerId());
        if (forwarder == null) {
          LOG.error("Forwarder for the relayed peer not found. Cannot send late response {}", realMessage);
          responder.response(createResponseMessage(message, Type.NOT_FOUND));
        } else {
           // because buffer is re-encoded when forwarding it to unreachable
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.