@@ -0,0 +1,684 @@
+package com.tacitknowledge.performance.degrade;%0A%0Aimport com.tacitknowledge.performance.Component;%0A%0Aimport io.netty.channel.ChannelHandlerContext;%0Aimport io.netty.channel.ChannelInboundHandlerAdapter;%0Aimport io.netty.channel.socket.SocketChannel;%0A%0A/** @author Ivan Frolov (ifrolov@tacitknowledge.com) */%0Apublic class PeerClose implements Component%0A%7B%0A    @Override%0A    public void initChannel(final SocketChannel ch)%0A    %7B%0A        ch.pipeline().addLast(new ChannelInboundHandlerAdapter()%7B%0A            @Override%0A            public void channelActive(final ChannelHandlerContext ctx) throws Exception%0A            %7B%0A                ctx.channel().close();%0A            %7D%0A        %7D);%0A    %7D%0A%7D%0A

Implement peer close on connection degradation handler.