Skip to content

Instantly share code, notes, and snippets.

@Cloven
Created December 10, 2012 17:41
Show Gist options
  • Select an option

  • Save Cloven/4252065 to your computer and use it in GitHub Desktop.

Select an option

Save Cloven/4252065 to your computer and use it in GitHub Desktop.
ChannelInitializer for netty4a8 example
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