Skip to content

Home > @esengine/ecs-framework-monorepo > RpcCallProxy

RpcCallProxy class

RPC调用代理 负责发送RPC调用并处理响应

Signature:

typescript
export declare class RpcCallProxy extends EventEmitter

Extends: EventEmitter

Constructors

Constructor

Modifiers

Description

(constructor)(networkSender, config)

Constructs a new instance of the RpcCallProxy class

Properties

Property

Modifiers

Type

Description

clientRpc

readonly

ClientRpcInvoker

客户端RPC调用器

serverRpc

readonly

ServerRpcInvoker

服务端RPC调用器(用于服务端调用客户端)

Methods

Method

Modifiers

Description

call(methodName, args, options, targetId)

发起RPC调用

cancelCall(callId)

取消RPC调用

destroy()

销毁代理

getPendingCalls()

获取待处理的调用

getStats()

获取统计信息

handleResponse(response)

处理RPC响应

resetStats()

重置统计信息

setOnlineStatus(online)

设置网络状态

updateConfig(newConfig)

更新配置

基于 MIT 许可证发布