Search in sources :

Example 1 with ClientHeartbeatHandler

use of com.jim.framework.rpc.keepalive.ClientHeartbeatHandler in project jim-framework by jiangmin168168.

the class RpcClientInitializer method initChannel.

@Override
protected void initChannel(SocketChannel socketChannel) throws Exception {
    ChannelPipeline cp = socketChannel.pipeline();
    cp.addLast(new RpcEncoder(RpcRequest.class));
    cp.addLast(new RpcDecoder(RpcResponse.class));
    cp.addLast(new IdleStateHandler(0, 0, Constants.ALLIDLE_TIME_SECONDS));
    cp.addLast(new ClientHeartbeatHandler());
    cp.addLast(new RpcClientInvoker(this.getFilterMap()));
}
Also used : RpcEncoder(com.jim.framework.rpc.codec.RpcEncoder) IdleStateHandler(io.netty.handler.timeout.IdleStateHandler) RpcRequest(com.jim.framework.rpc.common.RpcRequest) ClientHeartbeatHandler(com.jim.framework.rpc.keepalive.ClientHeartbeatHandler) RpcDecoder(com.jim.framework.rpc.codec.RpcDecoder) RpcResponse(com.jim.framework.rpc.common.RpcResponse) ChannelPipeline(io.netty.channel.ChannelPipeline)

Aggregations

RpcDecoder (com.jim.framework.rpc.codec.RpcDecoder)1 RpcEncoder (com.jim.framework.rpc.codec.RpcEncoder)1 RpcRequest (com.jim.framework.rpc.common.RpcRequest)1 RpcResponse (com.jim.framework.rpc.common.RpcResponse)1 ClientHeartbeatHandler (com.jim.framework.rpc.keepalive.ClientHeartbeatHandler)1 ChannelPipeline (io.netty.channel.ChannelPipeline)1 IdleStateHandler (io.netty.handler.timeout.IdleStateHandler)1