define

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 最大傳輸單元(Maximum Transmission Unit): 最大封包大小
	MTU         int32 = 1500
	DATALENGTH  int32 = 4
	BUFFER_SIZE int32 = 10
)

Variables

View Source
var ConnectStateString = []string{
	"Unused",
	"Connecting",
	"Connected",
	"Timeout",
	"Disconnect",
	"Reconnect",
}

Functions

This section is empty.

Types

type ConnectState

type ConnectState int32
const (
	// 未使用
	Unused ConnectState = iota
	// 嘗試連線中(如果 通訊模式 尚未確定,就傳回嘗試連線中)
	Connecting
	// 連線中
	Connected
	// 超時斷線
	Timeout
	// 斷線
	Disconnect
	// 重新連線中
	Reconnect
)

func (ConnectState) String

func (cs ConnectState) String() string

type EventType added in v1.2.1

type EventType int32
const (
	// 連線事件
	OnConnected EventType = iota
	// 準備完成事件
	OnReady
	// 斷線事件
	OnDisconnect
)

type SocketType

type SocketType byte
const (
	// 前 4 碼為數據長度,後面才是實際要傳的數據
	Tcp0 SocketType = iota
	Http
)

func (SocketType) String

func (s SocketType) String() string

Jump to

Keyboard shortcuts

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