Search in sources :

Example 6 with PingPayloadPacket

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

the class DefaultPinpointClientHandler method sendPing.

public void sendPing() {
    if (!state.isEnableCommunication()) {
        return;
    }
    logger.debug("{} sendPing() started.", objectUniqName);
    PingPayloadPacket pingPacket = new PingPayloadPacket(pingIdGenerator.incrementAndGet(), (byte) 0, state.getCurrentStateCode().getId());
    ChannelFuture future = write0(pingPacket);
    future.awaitUninterruptibly();
    if (!future.isSuccess()) {
        Throwable cause = future.getCause();
        throw new PinpointSocketException("send ping failed. Error:" + cause.getMessage(), cause);
    }
    logger.debug("{} sendPing() completed.", objectUniqName);
}
Also used : ChannelFuture(org.jboss.netty.channel.ChannelFuture) PinpointSocketException(com.navercorp.pinpoint.rpc.PinpointSocketException) PingPayloadPacket(com.navercorp.pinpoint.rpc.packet.PingPayloadPacket)

Aggregations

PingPayloadPacket (com.navercorp.pinpoint.rpc.packet.PingPayloadPacket)6 TestRawSocket (com.navercorp.pinpoint.test.client.TestRawSocket)3 TestPinpointServerAcceptor (com.navercorp.pinpoint.test.server.TestPinpointServerAcceptor)3 TestServerMessageListenerFactory (com.navercorp.pinpoint.test.server.TestServerMessageListenerFactory)3 Test (org.junit.Test)3 ProtocolException (com.navercorp.pinpoint.rpc.control.ProtocolException)2 IOException (java.io.IOException)2 PinpointSocketException (com.navercorp.pinpoint.rpc.PinpointSocketException)1 ChannelFuture (org.jboss.netty.channel.ChannelFuture)1 Ignore (org.junit.Ignore)1