Documentation ¶
Index ¶
- Variables
- func CompressBytes(data []byte) ([]byte, error)
- func DecompressBytes(data []byte) ([]byte, error)
- func DetectPort(addr string, fn func(string) (interface{}, error)) (interface{}, error)
- func FileExists(name string) bool
- func FileSize(name string) int64
- func GetLocalIP() string
- func GetPrivateIPv4() ([]*net.IPAddr, error)
- func GetPublicIPv6() ([]*net.IPAddr, error)
- func GetRemoteAddrss(ses cellnet.Session) (string, bool)
- func IsEOFOrNetReadError(err error) bool
- func JoinAddress(host string, port int) string
- func ReadFileLines(filename string, callback func(line string) bool) error
- func RecvLTVPacket(reader io.Reader, maxPacketSize int) (msg interface{}, err error)
- func SendLTVPacket(writer io.Writer, ctx cellnet.ContextSet, data interface{}) error
- func SpliteAddress(addr string) (host string, port int, err error)
- func StringHash(s string) (hash uint16)
- func WriteFull(writer io.Writer, buf []byte) error
- type Queue
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMaxPacket = errors.New("packet over size") ErrMinPacket = errors.New("packet short size") ErrShortMsgID = errors.New("short msgid") )
View Source
var (
ErrInvalidPortRange = errors.New("invalid port range")
)
Functions ¶
func CompressBytes ¶
func DecompressBytes ¶
func DetectPort ¶
在给定的端口范围内找到一个能用的端口 格式: localhost:5000~6000
func FileExists ¶
func GetPrivateIPv4 ¶
GetPrivateIPv4 returns the list of private network IPv4 addresses on all active interfaces.
func GetPublicIPv6 ¶
GetPublicIPv6 returns the list of all public IPv6 addresses on all active interfaces.
func IsEOFOrNetReadError ¶
func ReadFileLines ¶
读取文本文件的所有行
func RecvLTVPacket ¶
接收Length-Type-Value格式的封包流程
func SendLTVPacket ¶
func SendLTVPacket(writer io.Writer, ctx cellnet.ContextSet, data interface{}) error
发送Length-Type-Value格式的封包流程
Types ¶
Click to show internal directories.
Click to hide internal directories.