mirror of
https://gitee.com/BDWare/router-backend
synced 2025-01-25 01:04:05 +00:00
fix: fix bugs in event mechanism
fix bugs in event delivering cross nodes
This commit is contained in:
parent
3ab558bf10
commit
b0e87f8f0a
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -146,9 +146,9 @@ public class NodeCenterFrameHandler extends SimpleChannelInboundHandler<Object>
|
||||
}
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user