stream

package
v0.0.0-...-212a885 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const MagicHead = 0x574a1029

MagicHead 魔法数字

View Source
const PktDefaultSize = 512 * 1024

PktDefaultSize 默认数据包大小 512K

View Source
const PktMask = 0x7fffff

PktMask mask

View Source
const PktMaxSize = 1024 * 1024 * 7

PktMaxSize 最大数据包 7M

View Source
const PktMinSize = 1024

PktMinSize 最小数据包

Variables

This section is empty.

Functions

This section is empty.

Types

type Stream

type Stream struct {

	//CreateTime 创建时间
	CreateTime int64
	//LastConnectTime 最后连接时间
	LastConnectTime int64
	// contains filtered or unexported fields
}

Stream tcp 控制

func NewClient

func NewClient(user, password, host string, bufSize int) *Stream

NewClient 客户端模式

func NewServer

func NewServer(conn *net.TCPConn, check func(string, string) *ee.Error) (*Stream, *ee.Error)

NewServer 服务器模式

func (*Stream) Close

func (m *Stream) Close() (er *ee.Error)

Close 关闭

func (*Stream) GetSize

func (m *Stream) GetSize() int

GetSize 最大值

func (*Stream) IsGood

func (m *Stream) IsGood() bool

IsGood 连接是否正常

func (*Stream) Open

func (m *Stream) Open() *ee.Error

Open 打开连接

func (*Stream) Recv

func (m *Stream) Recv() (data []byte, er *ee.Error)

Recv 接收

func (*Stream) Send

func (m *Stream) Send(data []byte) (er *ee.Error)

Send 发送

Jump to

Keyboard shortcuts

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