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();
}
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;
}
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);
}
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());
}
Aggregations