This commit is contained in:
2019-09-18 01:43:58 +02:00
parent 34ec2d0244
commit 741c253202
10 changed files with 131 additions and 48 deletions
+5 -5
View File
@@ -2,17 +2,17 @@
Object.defineProperty(exports, "__esModule", { value: true });
const RPCSocketServer_1 = require("../src/backend/RPCSocketServer");
//@ts-ignore
const RPCaller_1 = require("../src/frontend/RPCaller");
const RPCSocket_1 = require("../src/frontend/RPCSocket");
new RPCSocketServer_1.RPCSocketServer(20000, [{
name: "HelloWorldRPCGroup",
exportPublicRPCs: () => [],
exportRPCs: () => [{
type: 'call',
name: 'echo',
func: async (s) => s,
visibility: 'private'
}]
}]);
const caller = new RPCaller_1.RPCaller(20000, 'localhost');
}],
}], "0.0.0.0");
const caller = new RPCSocket_1.RPCSocket(20000, 'localhost');
caller.connect().then(_ => {
caller.info().then(console.log);
caller["HelloWorldRPCGroup"].echo("x").then(console.log);