diff --git a/4.0/guide/index.html b/4.0/guide/index.html index 5d823833517..6835c4b5717 100644 --- a/4.0/guide/index.html +++ b/4.0/guide/index.html @@ -261,7 +261,7 @@
ChannelInboundByteHandlerAdapter
{ChannelHandlerContext
ctx, ByteBuf
in) {ChannelHandlerContext
ctx, ByteBuf
in) throws Exception {
- DiscardServerHandler
extends
- , which is an implementation of
- . provides various event
- handler methods that you can override. For now, it is just enough
- to extend ChannelInboundByteHandlerAdapter
rather than to implement
- the handler interfaces by yourself.
-
+ DiscardServerHandler
extends ChannelInboundByteHandlerAdapter
, which is an implementation of ChannelStateHandler
. ChannelStateHandler
provides various event handler methods that you can override. For now, it is just enough to extend ChannelInboundByteHandlerAdapter
rather than to implement the handler interfaces by yourself.
ServerBootstrap
bootstrap =
- 10 new ServerBootstrap
NioEventLoopGroup
(), new NioEventLoopGroup
NioEventLoopGroup
(), new NioEventLoopGroup
NioServerSocketChannel
.classChannelInitializer
<SocketChannel>() {1 @Override - 2 public void inboundBufferUpdated(ChannelHandlerContext
ctx,ByteBuf
in) { - while(in.readable()) { + 2 public void inboundBufferUpdated(ChannelHandlerContext
ctx,ByteBuf
in) throws Exception { + while(in.isReadable()) { 4 System.out.println((char) buf.readByte()); System.out.flush(); 6 } @@ -605,7 +599,7 @@5. Writing a Time Server
1 package io.netty.example.time; 2 - public class TimeServerHandler extends { + public class TimeServerHandler extendsChannelInboundByteHandlerAdapter
{ 4 @Override 6 public void channelActive(ChannelHandlerContext
ctx) {4. How do I pass data between handlers in the same Channel?