Created
December 10, 2012 17:41
-
-
Save Cloven/4252065 to your computer and use it in GitHub Desktop.
ChannelInitializer for netty4a8 example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TCPServiceChannelInitializer < ChannelInitializer | |
| def initChannel(sch) | |
| sch.pipeline().addLast(DelimiterBasedFrameDecoder.new(8192,Delimiters.lineDelimiter())) | |
| sch.pipeline().addLast(StringDecoder.new(Charset.defaultCharset())) | |
| sch.pipeline().addLast(ChannelInboundWorkHandler.new()) | |
| puts "Channel initialized" | |
| end | |
| def self.exceptionCaught(ctx,throwable) | |
| puts "exception caught\n" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment