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
@@ -1,18 +1,18 @@
import { RPCSocketServer } from '../src/backend/RPCSocketServer'
//@ts-ignore
import {RPCaller} from '../src/frontend/RPCaller'
import {RPCSocket} from '../src/frontend/RPCSocket'
new RPCSocketServer(20000, [{
name: "HelloWorldRPCGroup",
exportPublicRPCs: () => [],
exportRPCs: () => [{
type: 'call',
name: 'echo',
func: async (s:string) => s,
visibility: 'private'
}]
}] )
}],
}])
const caller = new RPCaller(20000, 'localhost')
const caller = new RPCSocket(20000, 'localhost')
caller.connect().then(_ => {
caller.info().then(console.log)
caller["HelloWorldRPCGroup"].echo("x").then(console.log)