Documentation
¶
Overview ¶
rpc2d 双向 RPC 调用,可以实现从服务器 CALLBACK 客户端 API,基于 "net/rpc" 原生库
Index ¶
Constants ¶
View Source
const ( S = byte('S') //Flag : Server Message C = byte('C') //Flag : Client Message E = byte('E') //Flag : Error T = byte('T') //Flag : Timeout )
wrap message( []byte ): "T uint8 + length uint16 + bytes [length]byte". T = S/C/E
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProviderType ¶
ProviderType This is NOT must fit below struct. But this struct can help CALLBACK. See test server.go/client.go
type RpcNode ¶
type RpcNode struct { Server *rpc.Server Client *rpc.Client // contains filtered or unexported fields }
RpcNode double direction RPC
func NewRpcNode ¶
func NewRpcNode(provider interface{}) *RpcNode
NewRpcNode create new Rpc.Node ,init rpc.Server with service provider
func NewRpcNodeByConn ¶ added in v1.0.8
func NewRpcNodeByConn(provider interface{}, conn io.ReadWriteCloser) *RpcNode
NewRpcNodeByConn connect to remote by io.ReadWriteCloser, and link local server/client,use after NewRpcNode
Click to show internal directories.
Click to hide internal directories.