transport

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: MIT Imports: 0 Imported by: 3

Documentation

Index

Constants

View Source
const (
	TRANS_WORKING = iota
	TRANS_CLOSED
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ITransport

type ITransport interface {
	Wirte(pkg []byte, length int) (int, error) //往缓冲区写入
	Read(pkg []byte, length int) (int, error)  //从缓冲区读取,并且移除数据
	Peek(length int) ([]byte, int, error)      //获取头部的定长数据 但是不移除他们
	Send(pkg []byte) error                     //发送数据包 多协程调用
	Close()                                    //关闭
	Size() uint32                              //返回读队列长度
	IsClose() bool                             //查询状态
	GetID() uint32                             //获取Trans ID
	SetID(transID uint32)                      //设置Trans ID
	LocalAddr() string                         // LocalAddr returns the local network address.
	RemoteAddr() string                        // RemoteAddr returns the remote network address.
}

ITransport rpc-backend-go, message binary tranporter interface recv protocol binary from network, application consume it recv protocol binary from application, network consume it

Jump to

Keyboard shortcuts

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