// Path: kcp-netty/src/main/java/io/jpower/kcp/netty/UkcpChannel.java
// public interface UkcpChannel extends Channel {
// 
//     int conv();
// 
//     @Override
//     UkcpChannelConfig config();
// 
//     UkcpChannel conv(int conv);
// 
//     @Override
//     InetSocketAddress localAddress();
// 
//     @Override
//     InetSocketAddress remoteAddress();
// 
// }


import io.jpower.kcp.netty.UkcpChannel;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
package io.jpower.kcp.example.echo;


/**
 * Handler implementation for the echo client.
 *
 * @author <a href="mailto:szhnet@gmail.com">szh</a>
 */
public class EchoClientHandler extends ChannelInboundHandlerAdapter {

    private final ByteBuf firstMessage;

    /**
     * Creates a client-side handler.
     */
    public EchoClientHandler() {
        firstMessage = Unpooled.buffer(EchoClient.SIZE);
        for (int i = 0; i < firstMessage.capacity(); i++) {
            firstMessage.writeByte((byte) i);
        }
    }

    @Override
    public void channelActive(ChannelHandlerContext ctx) {
// Path: kcp-netty/src/main/java/io/jpower/kcp/netty/UkcpChannel.java
// public interface UkcpChannel extends Channel {
// 
//     int conv();
// 
//     @Override
//     UkcpChannelConfig config();
// 
//     UkcpChannel conv(int conv);
// 
//     @Override
//     InetSocketAddress localAddress();
// 
//     @Override
//     InetSocketAddress remoteAddress();
// 
// }


// Path: kcp-example/src/main/java/io/jpower/kcp/example/echo/EchoClientHandler.java
import io.jpower.kcp.netty.UkcpChannel;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

package io.jpower.kcp.example.echo;


/**
 * Handler implementation for the echo client.
 *
 * @author <a href="mailto:szhnet@gmail.com">szh</a>
 */
public class EchoClientHandler extends ChannelInboundHandlerAdapter {

    private final ByteBuf firstMessage;

    /**
     * Creates a client-side handler.
     */
    public EchoClientHandler() {
        firstMessage = Unpooled.buffer(EchoClient.SIZE);
        for (int i = 0; i < firstMessage.capacity(); i++) {
            firstMessage.writeByte((byte) i);
        }
    }

    @Override
    public void channelActive(ChannelHandlerContext ctx) {
        UkcpChannel kcpCh = (UkcpChannel) ctx.channel();