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)
})
