net

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NET_SKIP = iota
	NET_CONN
	NET_DATA
	NET_CLOSED
	NET_ERR
)

Response types

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener added in v1.5.0

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

func Listen added in v1.5.0

func Listen(host string, port int) (*Listener, error)

Constructor

func (*Listener) Close added in v1.5.0

func (network *Listener) Close()

func (*Listener) IsClosed added in v1.5.0

func (network *Listener) IsClosed() bool

func (*Listener) Refresh added in v1.5.0

func (network *Listener) Refresh() Response

type Response added in v1.5.0

type Response struct {
	Type int
	Data []any
}

type Socket added in v1.5.0

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

func Connect added in v1.5.0

func Connect(host string, port int) (*Socket, error)

func SocketFromTCPConn added in v1.5.0

func SocketFromTCPConn(conn *net.TCPConn) *Socket

Constructors

func (*Socket) Close added in v1.5.0

func (socket *Socket) Close()

func (*Socket) IsClosed added in v1.5.0

func (socket *Socket) IsClosed() bool

Standard methods

func (*Socket) LocalAddress added in v1.5.0

func (socket *Socket) LocalAddress() net.Addr

func (*Socket) Refresh added in v1.5.0

func (socket *Socket) Refresh() Response

func (*Socket) RemoteAddress added in v1.5.0

func (socket *Socket) RemoteAddress() net.Addr

func (*Socket) Write added in v1.5.0

func (socket *Socket) Write(buffer *bytes.Buffer) (int, error)

Jump to

Keyboard shortcuts

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