Skip to content

Instantly share code, notes, and snippets.

@oshothebig
Created September 3, 2011 10:06
Show Gist options
  • Save oshothebig/1190950 to your computer and use it in GitHub Desktop.
Save oshothebig/1190950 to your computer and use it in GitHub Desktop.
public ChannelPipeline getPipeline() throws Exception {
ChannelPipeline pipeline = Channels.pipeline();
// add the binary codec combination first
pipeline.addLast("framer", new LengthFieldBasedFrameDecoder(
MAXIMUM_PACKET_LENGTH, LENGTH_FIELD_OFFSET, LENGTH_FIELD_LENGTH, LENGTH_FIELD_MODIFICATION, 0));
pipeline.addLast("decoder", new OpenFlowDecoder());
pipeline.addLast("encoder", new OpenFlowEncoder());
// add then the business logic
pipeline.addLast("handler", new OpenFlowSimpleControllerHandler(controller));
return pipeline;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment