Skip to content

Instantly share code, notes, and snippets.

@nickman
Created June 12, 2012 13:44
Show Gist options
  • Select an option

  • Save nickman/2917590 to your computer and use it in GitHub Desktop.

Select an option

Save nickman/2917590 to your computer and use it in GitHub Desktop.
MyStringServerFactory - All Exclusive
public class MyStringServerFactory implements ChannelPipelineFactory {
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline p = Channels.pipeline();
// Decoders
p.addLast("frameDecoder", new DelimiterBasedFrameDecoder(Delimiters.lineDelimiter()));
p.ddLast("stringDecoder", new StringDecoder(CharsetUtil.UTF_8));
// Encoder
p.addLast("stringEncoder", new StringEncoder(CharsetUtil.UTF_8));
return p;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment