Created
September 3, 2011 10:05
-
-
Save oshothebig/1190948 to your computer and use it in GitHub Desktop.
This file contains 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
private static class OpenFlowDecoder extends OneToOneDecoder { | |
@Override | |
protected Object decode(ChannelHandlerContext ctx, Channel channel, Object msg) throws Exception { | |
if (!(msg instanceof ChannelBuffer)) { | |
return msg; | |
} | |
ChannelBuffer channelBuffer = (ChannelBuffer)msg; | |
ByteBuffer byteBuffer = channelBuffer.toByteBuffer(); | |
List<OFMessage> messages = factory.parseMessages(byteBuffer); | |
return messages.get(0); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment