I am new to Netty. One thing I find confusing is that ServerBootstrap has two methods: handler( ChannelHandler c), which is inherited from AbstractBootstrap, and childHandler( ChannelHandler c), both of which seem to be doing the same thing, based on the javadoc. So, is that true? Are there any differences between the two methods?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
The
handler
, which is defined in the AbstractBootstrap is used when writing Netty based clients.When writing netty based servers, that can work upon multiple accepted channels, use a child handler which will handle I/O and data for the accepted channes, by using
childHandler
as defined in the ServerBootstrap.Handler method will be executed on ServerBootstrap initialization, however
childHandler
will be executed when connection completes.When you start the server, you can see the log as below: