This commit is contained in:
2019-09-18 00:58:27 +02:00
parent 615619e6e7
commit 41a5d14fd8
34 changed files with 1758 additions and 35 deletions
+19
View File
@@ -0,0 +1,19 @@
import { RPCSocketServer } from '../src/backend/RPCSocketServer'
//@ts-ignore
import {RPCaller} from '../src/frontend/RPCaller'
new RPCSocketServer(20000, [{
name: "HelloWorldRPCGroup",
exportRPCs: () => [{
type: 'call',
name: 'echo',
func: async (s:string) => s,
visibility: 'private'
}]
}] )
const caller = new RPCaller(20000, 'localhost')
caller.connect().then(_ => {
caller.info().then(console.log)
caller["HelloWorldRPCGroup"].echo("x").then(console.log)
})