npm.io
1.0.13 • Published 3 years ago

@ezgame/rpc

Licence
ISC
Version
1.0.13
Deps
3
Size
66 kB
Vulns
0
Weekly
0

EasyGame rpc module

overview

this module is ezgame rpc module

install

npm i @ezgame/rpc

usage


import { TCPCommunicator } from "@ezgame/rpc"
import * as Log from "@ezgame/log"
import * as protocol from './protocol'

const Tag = "TEST"

async function run(){
    try{
        var comm = new TCPCommunicator();
        var proxy = await comm.connect("localhost", 7001, protocol.TestProxy);
        var r = await proxy.test("aaa", 111);
        Log.debug(Tag, "test result: ", r);
    }
    catch(e){
        Log.error(Tag, "error: ", e);
    }
}

run();