Search in sources :

Example 1 with ControlHandshakePacket

use of com.navercorp.pinpoint.rpc.packet.ControlHandshakePacket in project pinpoint by naver.

the class PinpointServerStateTest method createHandshakePayload.

private byte[] createHandshakePayload(Map<String, Object> data) throws ProtocolException {
    byte[] payload = ControlMessageEncodingUtils.encode(data);
    ControlHandshakePacket handshakePacket = new ControlHandshakePacket(payload);
    ChannelBuffer channelBuffer = handshakePacket.toBuffer();
    return channelBuffer.toByteBuffer().array();
}
Also used : ControlHandshakePacket(com.navercorp.pinpoint.rpc.packet.ControlHandshakePacket) ChannelBuffer(org.jboss.netty.buffer.ChannelBuffer)

Example 2 with ControlHandshakePacket

use of com.navercorp.pinpoint.rpc.packet.ControlHandshakePacket in project pinpoint by naver.

the class PinpointClientHandshaker method createHandshakeJob.

private HandshakeJob createHandshakeJob(Channel channel, Map<String, Object> handshakeData) throws ProtocolException {
    byte[] payload = ControlMessageEncodingUtils.encode(handshakeData);
    ControlHandshakePacket handshakePacket = new ControlHandshakePacket(payload);
    HandshakeJob handshakeJob = new HandshakeJob(channel, handshakePacket);
    return handshakeJob;
}
Also used : ControlHandshakePacket(com.navercorp.pinpoint.rpc.packet.ControlHandshakePacket)

Example 3 with ControlHandshakePacket

use of com.navercorp.pinpoint.rpc.packet.ControlHandshakePacket in project pinpoint by naver.

the class PinpointClientHandshaker method handshake.

private void handshake(HandshakeJob handshakeJob) {
    handshakeCount.incrementAndGet();
    Channel channel = handshakeJob.getChannel();
    ControlHandshakePacket packet = handshakeJob.getHandshakePacket();
    logger.info("{} do handshake({}/{}). channel:{}.", simpleClassNameAndHashCodeString(), handshakeCount.get(), maxHandshakeCount, channel);
    final ChannelFuture future = channel.write(packet);
    future.addListener(handShakeFailFutureListener);
}
Also used : ChannelFuture(org.jboss.netty.channel.ChannelFuture) Channel(org.jboss.netty.channel.Channel) ControlHandshakePacket(com.navercorp.pinpoint.rpc.packet.ControlHandshakePacket)

Example 4 with ControlHandshakePacket

use of com.navercorp.pinpoint.rpc.packet.ControlHandshakePacket in project pinpoint by naver.

the class ControlPacketServerTest method sendRegisterPacket.

private void sendRegisterPacket(OutputStream outputStream, Map<String, Object> properties) throws ProtocolException, IOException {
    byte[] payload = ControlMessageEncodingUtils.encode(properties);
    ControlHandshakePacket packet = new ControlHandshakePacket(1, payload);
    ByteBuffer bb = packet.toBuffer().toByteBuffer(0, packet.toBuffer().writerIndex());
    sendData(outputStream, bb.array());
}
Also used : ControlHandshakePacket(com.navercorp.pinpoint.rpc.packet.ControlHandshakePacket) ByteBuffer(java.nio.ByteBuffer)

Aggregations

ControlHandshakePacket (com.navercorp.pinpoint.rpc.packet.ControlHandshakePacket)4 ByteBuffer (java.nio.ByteBuffer)1 ChannelBuffer (org.jboss.netty.buffer.ChannelBuffer)1 Channel (org.jboss.netty.channel.Channel)1 ChannelFuture (org.jboss.netty.channel.ChannelFuture)1