rpc2d

package module
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2019 License: GPL-2.0 Imports: 7 Imported by: 1

README

rpc2d

项目介绍

rpc2d 双向 RPC 调用,可以实现从服务器 CALLBACK 客户端 API,基于 "net/rpc" 原生库

use: SEE test/server.gotest/client.go

NewRpcNodeByConn 函数兼容 gitee.com/rocket049/pipeconn

软件架构

软件架构说明

安装教程
  1. xxxx
  2. xxxx
  3. xxxx
使用说明
type ProviderType
type RpcNode
    func Accept(l net.Listener, provider interface{}) (*RpcNode, error)
    func NewRpcNode(provider interface{}) *RpcNode
    func NewRpcNodeByConn(provider interface{}, conn io.ReadWriteCloser) *RpcNode
    func (self *RpcNode) Close()
    func (self *RpcNode) Dial(addr string) error
参与贡献
  1. Fork 本项目
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
码云特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. 码云官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解码云上的优秀开源项目
  4. GVP 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
  5. 码云官方提供的使用手册 https://gitee.com/help
  6. 码云封面人物是一档用来展示码云会员风采的栏目 https://gitee.com/gitee-stars/

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

type ProviderType struct {
	Client *rpc.Client
	Data   interface{}
}

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 Accept

func Accept(l net.Listener, provider interface{}) (*RpcNode, error)

Accept accept remote connection,and link local server/client

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

func (*RpcNode) Close

func (self *RpcNode) Close()

Close close

func (*RpcNode) Dial

func (self *RpcNode) Dial(addr string) error

Dial connect to remote, and link local server/client,use after NewRpcNode

Directories

Path Synopsis
测试和 gitee.com/rocket049/pipeconn 的兼容性 测试和 gitee.com/rocket049/pipeconn 的兼容性
测试和 gitee.com/rocket049/pipeconn 的兼容性 测试和 gitee.com/rocket049/pipeconn 的兼容性

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL