提交 3e6f9e92 编写于 作者: 武汉红喜's avatar 武汉红喜

netty

上级 f18cc37c
......@@ -26,11 +26,11 @@ import java.util.concurrent.atomic.AtomicInteger;
*/
public class ObjectEchoServerHandler extends ChannelInboundHandlerAdapter {
private int counter;
private int count;
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) {
if (counter++ % 1000 == 0) {
if (count++ % 1000 == 0) {
System.out.println("received Object: " + msg);
}
// Echo back the received object to the client.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册