net

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Network

type Network struct {
	Events *event.EventHandler
	// contains filtered or unexported fields
}

func NetworkListen

func NetworkListen(host string, port int) (*Network, error)

Constructor

func (*Network) Close

func (network *Network) Close()

func (*Network) ListenEvent

func (network *Network) ListenEvent(name string, callback func(event.Args))

Event methods

func (*Network) ListenEventOnce

func (network *Network) ListenEventOnce(name string, callback func(event.Args))

type NetworkSocket

type NetworkSocket struct {
	Events *event.EventHandler
	// contains filtered or unexported fields
}

func NetworkSocketConnect

func NetworkSocketConnect(host string, port int) (*NetworkSocket, error)

func NetworkSocketFrom

func NetworkSocketFrom(conn *net.TCPConn) *NetworkSocket

Constructors

func (*NetworkSocket) Close

func (socket *NetworkSocket) Close()

func (*NetworkSocket) ListenEvent

func (socket *NetworkSocket) ListenEvent(name string, callback func(event.Args))

Event methods

func (*NetworkSocket) ListenEventOnce

func (socket *NetworkSocket) ListenEventOnce(name string, callback func(event.Args))

func (*NetworkSocket) LocalAddress

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

func (*NetworkSocket) Poll

func (socket *NetworkSocket) Poll()

func (*NetworkSocket) RemoteAddress

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

func (*NetworkSocket) Write

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

Jump to

Keyboard shortcuts

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