本文整理汇总了Java中org.projectfloodlight.openflow.protocol.OFFactories.getGenericReader方法的典型用法代码示例。如果您正苦于以下问题:Java OFFactories.getGenericReader方法的具体用法?Java OFFactories.getGenericReader怎么用?Java OFFactories.getGenericReader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.projectfloodlight.openflow.protocol.OFFactories
的用法示例。
在下文中一共展示了OFFactories.getGenericReader方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: decode
import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
@Override
protected Object decode(ChannelHandlerContext ctx, Channel channel,
ChannelBuffer buffer) throws Exception {
if (!channel.isConnected()) {
// In testing, I see decode being called AFTER decode last.
// This check avoids that from reading corrupted frames
return null;
}
// Note that a single call to decode results in reading a single
// OFMessage from the channel buffer, which is passed on to, and processed
// by, the controller (in OFChannelHandler).
// This is different from earlier behavior (with the original openflowj),
// where we parsed all the messages in the buffer, before passing on
// a list of the parsed messages to the controller.
// The performance *may or may not* not be as good as before.
OFMessageReader<OFMessage> reader = OFFactories.getGenericReader();
OFMessage message = reader.readFrom(buffer);
return message;
}
示例2: setReader
import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
private void setReader() {
reader = OFFactories.getGenericReader();
}
示例3: OFMessageDecoder
import org.projectfloodlight.openflow.protocol.OFFactories; //导入方法依赖的package包/类
public OFMessageDecoder() {
reader = OFFactories.getGenericReader();
}