X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=replicate%2Fmdsal-replicate-netty%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fmdsal%2Freplicate%2Fnetty%2FConstants.java;h=8041640ebce19d8ab7c136a11c21c208455a5b3d;hb=b94fbc60c0b41da2f6645ab51188fbcdfa74e4af;hp=eddf8d6dbaa341d3c21e4f1b672780ebc22e7df0;hpb=d7b666857c54c07d9bf5c8e5e38671151d89fb4c;p=mdsal.git diff --git a/replicate/mdsal-replicate-netty/src/main/java/org/opendaylight/mdsal/replicate/netty/Constants.java b/replicate/mdsal-replicate-netty/src/main/java/org/opendaylight/mdsal/replicate/netty/Constants.java index eddf8d6dba..8041640ebc 100644 --- a/replicate/mdsal-replicate-netty/src/main/java/org/opendaylight/mdsal/replicate/netty/Constants.java +++ b/replicate/mdsal-replicate-netty/src/main/java/org/opendaylight/mdsal/replicate/netty/Constants.java @@ -32,6 +32,14 @@ final class Constants { * End-of-DataTreeCandidate serialization stream. The payload is empty. */ static final byte MSG_DTC_APPLY = 4; + /** + * Verify the connection is alive. + */ + static final int MSG_PING = 5; + /** + * Verify the connection is alive. + */ + static final int MSG_PONG = 6; /** * Length of the length field in each transmitted frame. @@ -42,8 +50,16 @@ final class Constants { */ static final int LENGTH_FIELD_MAX = 1024 * 1024; - static final ByteBuf EMPTY_DATA = Unpooled.wrappedBuffer(new byte[] { MSG_EMPTY_DATA }); - static final ByteBuf DTC_APPLY = Unpooled.wrappedBuffer(new byte[] { MSG_DTC_APPLY }); + static final ByteBuf EMPTY_DATA = Unpooled.unreleasableBuffer( + Unpooled.wrappedBuffer(new byte[] { MSG_EMPTY_DATA })); + + static final ByteBuf DTC_APPLY = Unpooled.unreleasableBuffer(Unpooled.wrappedBuffer(new byte[] { MSG_DTC_APPLY })); + + static final ByteBuf PING = Unpooled.unreleasableBuffer( + Unpooled.wrappedBuffer(new byte[] { MSG_PING })); + + static final ByteBuf PONG = Unpooled.unreleasableBuffer( + Unpooled.wrappedBuffer(new byte[] { MSG_PONG })); private Constants() { // Hidden on purpose