net

package module
v0.0.0-...-2134b18 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2018 License: MIT Imports: 5 Imported by: 0

README

go-net

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallbackConnect

type CallbackConnect func(*Handle, bool, error)

type CallbackDisconnect

type CallbackDisconnect func(*Handle, error)

type CallbackRead

type CallbackRead func(*Handle, []byte, int)

type Handle

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

func (*Handle) Addr

func (h *Handle) Addr() net.Addr

func (*Handle) Close

func (h *Handle) Close()

func (*Handle) Read

func (h *Handle) Read(onRead CallbackRead)

func (*Handle) ReadSize

func (h *Handle) ReadSize(size int, onRead CallbackRead)

func (*Handle) ReadToBuffer

func (h *Handle) ReadToBuffer(buffer []byte, size int, onRead CallbackRead)

func (*Handle) Send

func (h *Handle) Send(data []byte)

type NetPacket

type NetPacket struct {
	PacketSize int
	Buffer     []byte
	OnRead     CallbackRead
}

type Tcp

type Tcp struct {
	OnConnectResult CallbackConnect
	OnDisconnect    CallbackDisconnect
	OnRead          CallbackRead
	// contains filtered or unexported fields
}

func NewTcp

func NewTcp(onConnect CallbackConnect, onDisconnect CallbackDisconnect, onRead CallbackRead) *Tcp

func (*Tcp) Close

func (t *Tcp) Close()

func (*Tcp) Connect

func (t *Tcp) Connect(addr string)

func (*Tcp) Listen

func (t *Tcp) Listen(addr string) error

Jump to

Keyboard shortcuts

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