* BAEL-748 quick guide to @Value * BAEL-748 changes from review * BAEL-748 inject comma-separated values into array * BAEL-768 Introduction to Netty * BAEL-768 remove commented code
21 lines
637 B
Java
21 lines
637 B
Java
package com.baeldung.netty;
|
|
|
|
import io.netty.channel.ChannelHandlerContext;
|
|
import io.netty.channel.ChannelInboundHandlerAdapter;
|
|
|
|
public class ClientHandler extends ChannelInboundHandlerAdapter {
|
|
@Override
|
|
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
|
RequestData msg = new RequestData();
|
|
msg.setIntValue(123);
|
|
msg.setStringValue("all work and no play makes jack a dull boy");
|
|
ctx.writeAndFlush(msg);
|
|
}
|
|
|
|
@Override
|
|
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
|
System.out.println(msg);
|
|
ctx.close();
|
|
}
|
|
}
|