bootc

package
v1.0.33 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: GPL-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

View Source
const (
	KeyConnType string = "KeyConnType" // 连接类型
	KeyIP       string = "KeyIP"       // 连接IP
	KeyPort     string = "KeyPort"     // 连接端口
)

Variables

View Source
var Default = &Options{
	MsgType:              websocket.BinaryMessage,
	ByteOrder:            byteOrderBigEndian,
	ReadTimeOut:          30,
	WriteTimeOut:         30,
	ReadLimit:            256,
	PacketBytesCount:     4,
	LengthInclude:        false,
	SkipPacketBytesCount: false,
	channelParams:        make(map[string]interface{}),
}

Functions

func Serv added in v1.0.27

func Serv(opts ...Option) listener.IConnector

Types

type ByteOrder added in v1.0.31

type ByteOrder int8

type Option added in v1.0.27

type Option func(*Options)

func WithByteOrderLittleEndian added in v1.0.31

func WithByteOrderLittleEndian() Option

使用小端字节序

func WithInitializer added in v1.0.27

func WithInitializer(initializer channel.ChannelInitializer) Option

func WithKeyLengthInclude added in v1.0.31

func WithKeyLengthInclude() Option

包长度是否包含自己的长度

func WithLogger added in v1.0.27

func WithLogger(l logger.Logger) Option

func WithMsgType added in v1.0.31

func WithMsgType(msgType int) Option

func WithPacketBytesCount added in v1.0.31

func WithPacketBytesCount(packetBytesCount int32) Option

消息长度占用字节数

func WithReadLimit added in v1.0.31

func WithReadLimit(readLimit int32) Option

连接读取消息长度限制

func WithReadTimeOut added in v1.0.31

func WithReadTimeOut(readTimeOut int32) Option

连接读取消息超时时间

func WithSkipPacketBytesCount added in v1.0.31

func WithSkipPacketBytesCount() Option

跳过包长度

func WithWriteTimeOut added in v1.0.31

func WithWriteTimeOut(writeTimeOut int32) Option

连接写入消息超时时间

type Options added in v1.0.27

type Options struct {
	Initializer channel.ChannelInitializer
	Logger      logger.Logger

	MsgType              int
	ByteOrder            ByteOrder // 字节序
	ReadTimeOut          int32     // 连接读取消息超时时间
	WriteTimeOut         int32     // 连接写入消息超时时间
	ReadLimit            int32     // 连接读取消息长度限制
	PacketBytesCount     int32     // 消息长度占用字节数
	LengthInclude        bool      // 包长度是否包含自己的长度
	SkipPacketBytesCount bool      // 跳过包长度
	// contains filtered or unexported fields
}

Options contains some configurations for current node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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