event of response fix#3244 (#3247)
authorhuazhongming <crazyhzm@gmail.com>
Sat, 2 Feb 2019 03:42:20 +0000 (11:42 +0800)
committerIan Luo <ian.luo@gmail.com>
Sat, 2 Feb 2019 03:42:20 +0000 (11:42 +0800)
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/Response.java
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/codec/ExchangeCodec.java
dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/transport/codec/DeprecatedExchangeCodec.java
dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java

index d1ed88b..568ecf1 100644 (file)
@@ -137,6 +137,10 @@ public class Response {
         mResult = event;\r
     }\r
 \r
+    public void setEvent(boolean mEvent) {\r
+        this.mEvent = mEvent;\r
+    }\r
+\r
     public boolean isHeartbeat() {\r
         return mEvent && HEARTBEAT_EVENT == mResult;\r
     }\r
index 7eb64a1..8f25250 100644 (file)
@@ -142,7 +142,7 @@ public class ExchangeCodec extends TelnetCodec {
             // decode response.\r
             Response res = new Response(id);\r
             if ((flag & FLAG_EVENT) != 0) {\r
-                res.setEvent(Response.HEARTBEAT_EVENT);\r
+                res.setEvent(true);\r
             }\r
             // get status.\r
             byte status = header[3];\r
index 36b5831..552222d 100644 (file)
@@ -136,7 +136,7 @@ final class DeprecatedExchangeCodec extends DeprecatedTelnetCodec implements Cod
             // decode response.
             Response res = new Response(id);
             if ((flag & FLAG_EVENT) != 0) {
-                res.setEvent(Response.HEARTBEAT_EVENT);
+                res.setEvent(true);
             }
             // get status.
             byte status = header[3];
index 9c1e2fc..8a1b5ed 100644 (file)
@@ -68,7 +68,7 @@ public class DubboCodec extends ExchangeCodec implements Codec2 {
             // decode response.
             Response res = new Response(id);
             if ((flag & FLAG_EVENT) != 0) {
-                res.setEvent(Response.HEARTBEAT_EVENT);
+                res.setEvent(true);
             }
             // get status.
             byte status = header[3];