Code Review
/
openflowjava.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Quickfix - ActionsSerializer encodeSetFieldAction()"
[openflowjava.git]
/
simple-client
/
src
/
main
/
java
/
org
/
opendaylight
/
openflowjava
/
protocol
/
impl
/
clients
/
SimpleClientHandler.java
diff --git
a/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientHandler.java
b/simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientHandler.java
index 110570cdd842c0cd372be4c48a05a2a8522e1ff9..e9453b58437ada987f4763909aee3742c7881f81 100644
(file)
--- a/
simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientHandler.java
+++ b/
simple-client/src/main/java/org/opendaylight/openflowjava/protocol/impl/clients/SimpleClientHandler.java
@@
-19,6
+19,7
@@
import com.google.common.util.concurrent.SettableFuture;
public class SimpleClientHandler extends ChannelInboundHandlerAdapter {
\r
\r
protected static final Logger LOGGER = LoggerFactory.getLogger(SimpleClientHandler.class);
\r
public class SimpleClientHandler extends ChannelInboundHandlerAdapter {
\r
\r
protected static final Logger LOGGER = LoggerFactory.getLogger(SimpleClientHandler.class);
\r
+ private static final int LENGTH_INDEX_IN_HEADER = 2;
\r
private SettableFuture<Boolean> isOnlineFuture;
\r
protected ScenarioHandler scenarioHandler;
\r
\r
private SettableFuture<Boolean> isOnlineFuture;
\r
protected ScenarioHandler scenarioHandler;
\r
\r
@@
-33,15
+34,15
@@
public class SimpleClientHandler extends ChannelInboundHandlerAdapter {
\r
@Override
\r
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
\r
\r
@Override
\r
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
\r
- LOGGER.info("SimpleClientHandler - start of read");
\r
ByteBuf bb = (ByteBuf) msg;
\r
if (LOGGER.isDebugEnabled()) {
\r
LOGGER.debug("<< " + ByteBufUtils.byteBufToHexString(bb));
\r
}
\r
ByteBuf bb = (ByteBuf) msg;
\r
if (LOGGER.isDebugEnabled()) {
\r
LOGGER.debug("<< " + ByteBufUtils.byteBufToHexString(bb));
\r
}
\r
- byte[] message = new byte[8];
\r
+ int length = bb.getUnsignedShort(LENGTH_INDEX_IN_HEADER);
\r
+ LOGGER.info("SimpleClientHandler - start of read");
\r
+ byte[] message = new byte[length];
\r
bb.readBytes(message);
\r
scenarioHandler.addOfMsg(message);
\r
bb.readBytes(message);
\r
scenarioHandler.addOfMsg(message);
\r
- skipMsg(bb);
\r
LOGGER.info("end of read");
\r
}
\r
\r
LOGGER.info("end of read");
\r
}
\r
\r
@@
-57,12
+58,6
@@
public class SimpleClientHandler extends ChannelInboundHandlerAdapter {
\r
}
\r
\r
\r
}
\r
\r
- private static void skipMsg(ByteBuf bb) {
\r
- if (bb.readableBytes() > 0) {
\r
- bb.skipBytes(bb.getShort(2));
\r
- }
\r
- }
\r
-
\r
/**
\r
* @param scenarioHandler handler of scenario events
\r
*/
\r
/**
\r
* @param scenarioHandler handler of scenario events
\r
*/
\r