connx

package
v0.0.0-...-d9e9b57 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeadLenght     = 16
	HeadFlagLength = 4
)

Variables

View Source
var ErrorNotMatchHeadFlag = errors.New("not match head flag")
View Source
var HeadFlag uint32

Functions

func ReadMessage

func ReadMessage(conn net.Conn) ([]byte, error)

ReadMessage read message from conn

func SendMessage

func SendMessage(conn net.Conn, msgData []byte) error

SendMessage send message with conn

func Write

func Write(conn net.Conn, p []byte) (int, error)

func WriteMerge

func WriteMerge(conn net.Conn, head []byte, body []byte) (int, error)

Types

type HeadInfo

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

func (*HeadInfo) FromBytes

func (h *HeadInfo) FromBytes(b []byte)

FromBytes convert from bytes

func (*HeadInfo) GetBytes

func (h *HeadInfo) GetBytes() []byte

GetBytes get bytes

Jump to

Keyboard shortcuts

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