Netty Replicator - improve the reconnection and keepalive mechanisms
[mdsal.git] / replicate / mdsal-replicate-netty / src / main / java / org / opendaylight / mdsal / replicate / netty / Constants.java
index 1fff84f4e5df84f7da57dd967cc6ded774d0c637..8041640ebce19d8ab7c136a11c21c208455a5b3d 100644 (file)
@@ -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.
@@ -47,6 +55,12 @@ final class Constants {
 
     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
     }