From b0e87f8f0ad7245577615e8d35ff9ec62a94f247 Mon Sep 17 00:00:00 2001 From: "Frank.R.Wu" Date: Fri, 26 Nov 2021 15:54:34 +0800 Subject: [PATCH] fix: fix bugs in event mechanism fix bugs in event delivering cross nodes --- src/main/java/org/bdware/server/nodecenter/CMNode.java | 4 ++-- .../java/org/bdware/server/nodecenter/NodeCenterActions.java | 4 ++-- .../org/bdware/server/nodecenter/NodeCenterFrameHandler.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/bdware/server/nodecenter/CMNode.java b/src/main/java/org/bdware/server/nodecenter/CMNode.java index 035bc29..dfad6bb 100644 --- a/src/main/java/org/bdware/server/nodecenter/CMNode.java +++ b/src/main/java/org/bdware/server/nodecenter/CMNode.java @@ -37,8 +37,8 @@ public class CMNode { } } - public void sendEMsg(String msg) { - connection.controller.sendEMsg(msg); + public void sendEvent(String msg) { + connection.controller.sendEvent(msg); } public String formatContractName(String contractIDOrName) { diff --git a/src/main/java/org/bdware/server/nodecenter/NodeCenterActions.java b/src/main/java/org/bdware/server/nodecenter/NodeCenterActions.java index 61b7a3a..c69e887 100644 --- a/src/main/java/org/bdware/server/nodecenter/NodeCenterActions.java +++ b/src/main/java/org/bdware/server/nodecenter/NodeCenterActions.java @@ -668,7 +668,7 @@ public class NodeCenterActions { } @Action(async = true) - public void deliverEMessage(JsonObject json, ResultCallback cb) { + public void deliverEvent(JsonObject json, ResultCallback cb) { if (cb instanceof HttpResultCallback) { Response r = new Response(); r.action = "deliverEvent"; @@ -678,7 +678,7 @@ public class NodeCenterActions { } CMNode node = nodeInfos.get(json.get("target").getAsString()); - node.sendEMsg(json.get("msg").getAsString()); + node.sendEvent(json.get("msg").getAsString()); } @Action diff --git a/src/main/java/org/bdware/server/nodecenter/NodeCenterFrameHandler.java b/src/main/java/org/bdware/server/nodecenter/NodeCenterFrameHandler.java index af9aae5..31e29b6 100644 --- a/src/main/java/org/bdware/server/nodecenter/NodeCenterFrameHandler.java +++ b/src/main/java/org/bdware/server/nodecenter/NodeCenterFrameHandler.java @@ -146,9 +146,9 @@ public class NodeCenterFrameHandler extends SimpleChannelInboundHandler } } - public void sendEMsg(String msg) { + public void sendEvent(String msg) { Response r = new Response(); - r.action = "receiveEMsg"; + r.action = "deliverEvent"; r.data = msg; sendMsg(JsonUtil.toJson(r)); }