Documentation
¶
Index ¶
- Constants
- Variables
- func Serv(opts ...Option) listener.IConnector
- type ByteOrder
- type Option
- func WithByteOrderLittleEndian() Option
- func WithInitializer(initializer channel.ChannelInitializer) Option
- func WithKeyLengthInclude() Option
- func WithLogger(l logger.Logger) Option
- func WithMsgType(msgType int) Option
- func WithPacketBytesCount(packetBytesCount int32) Option
- func WithReadLimit(readLimit int32) Option
- func WithReadTimeOut(readTimeOut int32) Option
- func WithSkipPacketBytesCount() Option
- func WithWriteTimeOut(writeTimeOut int32) Option
- type Options
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 Option ¶ added in v1.0.27
type Option func(*Options)
func WithInitializer ¶ added in v1.0.27
func WithInitializer(initializer channel.ChannelInitializer) Option
func WithLogger ¶ added in v1.0.27
func WithMsgType ¶ added in v1.0.31
func WithPacketBytesCount ¶ added in v1.0.31
消息长度占用字节数
func WithWriteTimeOut ¶ added in v1.0.31
连接写入消息超时时间
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
Click to show internal directories.
Click to hide internal directories.