smn_net

package
v0.0.0-...-8887d1c Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 6 Imported by: 7

Documentation

Index

Constants

View Source
const (
	ErrNotGetEnoughLengthBytes = "ErrNotGetEnoughLengthBytes: needs:[%d], get[%d]"
)

Variables

This section is empty.

Functions

func ReadBytes

func ReadBytes(reader io.Reader) ([]byte, error)

func ReadFloat32

func ReadFloat32(reader io.Reader) (float32, error)

func ReadFloat64

func ReadFloat64(reader io.Reader) (float64, error)

func ReadInt

func ReadInt(reader io.Reader) (int, error)

func ReadInt16

func ReadInt16(reader io.Reader) (int16, error)

func ReadInt32

func ReadInt32(reader io.Reader) (int32, error)

func ReadInt64

func ReadInt64(reader io.Reader) (int64, error)

func ReadInt8

func ReadInt8(reader io.Reader) (int8, error)

func ReadString

func ReadString(reader io.Reader) (string, error)

func ReadUint

func ReadUint(reader io.Reader) (uint, error)

func ReadUint16

func ReadUint16(reader io.Reader) (uint16, error)

func ReadUint32

func ReadUint32(reader io.Reader) (uint32, error)

func ReadUint64

func ReadUint64(reader io.Reader) (uint64, error)

func ReadUint8

func ReadUint8(reader io.Reader) (uint8, error)

func WriteBytes

func WriteBytes(bts []byte, writer io.Writer) (int, error)

func WriteFloat32

func WriteFloat32(val float32, writer io.Writer) error

func WriteFloat64

func WriteFloat64(val float64, writer io.Writer) error

func WriteInt

func WriteInt(val int, writer io.Writer) error

func WriteInt16

func WriteInt16(val int16, writer io.Writer) error

func WriteInt32

func WriteInt32(val int32, writer io.Writer) error

func WriteInt64

func WriteInt64(val int64, writer io.Writer) error

func WriteInt8

func WriteInt8(val int8, writer io.Writer) error

func WriteString

func WriteString(val string, writer io.Writer) (int, error)

func WriteUint

func WriteUint(val uint, writer io.Writer) error

func WriteUint16

func WriteUint16(val uint16, writer io.Writer) error

func WriteUint32

func WriteUint32(val uint32, writer io.Writer) error

func WriteUint64

func WriteUint64(val uint64, writer io.Writer) error

func WriteUint8

func WriteUint8(val uint8, writer io.Writer) error

Types

type OnAccept

type OnAccept func(conn net.Conn)

type TcpServer

type TcpServer struct {
	Port      int
	Listener  net.Listener
	OnAccept  OnAccept
	OnErr     smn_err.OnErr
	OnRunning bool
	Data      interface{}
}

func NewTcpServer

func NewTcpServer(port int, onAccept OnAccept) (this *TcpServer, err error)

func (*TcpServer) Close

func (this *TcpServer) Close()

func (*TcpServer) Run

func (this *TcpServer) Run()

Jump to

Keyboard shortcuts

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