protocol

package
v0.0.0-...-1c511b4 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PackheadSize = constHeaderLength + constModesizeLength
)

Variables

This section is empty.

Functions

func BytesToUint16

func BytesToUint16(array []byte) []uint16

func Depack

func Depack(buffer []byte) (flag byte, size int)

解包

func DepackClip

func DepackClip(content []byte) (int, []byte)

func DepackCmd

func DepackCmd(content []byte) string

func EnpackClip

func EnpackClip(content []byte) (packet []byte)

封包

func Enpackhead

func Enpackhead(head byte, stat []byte) []byte

自动截断,只取前4位

func Listen

func Listen() (err error)

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

func Accept

func Accept() (*Conn, error)

func (*Conn) AccessGetHash

func (c *Conn) AccessGetHash(logger *log.Logger) (hash string)

func (*Conn) Close

func (c *Conn) Close(logger *log.Logger)

func (*Conn) GetAddr

func (c *Conn) GetAddr() string

func (*Conn) GetClip

func (c *Conn) GetClip(size int) (bool, []byte)

func (*Conn) GetLogger

func (c *Conn) GetLogger() (logger *log.Logger)

func (*Conn) RecvCmd

func (c *Conn) RecvCmd(buf []byte) (flag byte, size int)

func (*Conn) SendAccess

func (c *Conn) SendAccess() bool

func (*Conn) SendActive

func (c *Conn) SendActive() bool

func (*Conn) SendClip

func (c *Conn) SendClip(clip []byte) bool

func (*Conn) SendKeyErr

func (c *Conn) SendKeyErr() bool

func (*Conn) SendUpdate

func (c *Conn) SendUpdate() bool

func (*Conn) SetLogger

func (c *Conn) SetLogger(logger *log.Logger)

Jump to

Keyboard shortcuts

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