network

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	READ_BUFFER_SIZE = 81920
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedConnectionEvents

type BufferedConnectionEvents struct {
	ReceiveData *events.Event
	Close       *events.Event
	Error       *events.Event
}

type Callback

type Callback func()

type DataConsumer

type DataConsumer func(data []byte)

type ErrorConsumer

type ErrorConsumer func(err error)

type ManagedConnection

type ManagedConnection struct {
	Conn   net.Conn
	Events BufferedConnectionEvents

	BytesRead    int
	BytesWritten int
	// contains filtered or unexported fields
}

func NewManagedConnection

func NewManagedConnection(conn net.Conn) *ManagedConnection

func (*ManagedConnection) Close

func (this *ManagedConnection) Close() error

func (*ManagedConnection) LocalAddr

func (this *ManagedConnection) LocalAddr() net.Addr

func (*ManagedConnection) Read

func (this *ManagedConnection) Read(receiveBuffer []byte) (n int, err error)

func (*ManagedConnection) RemoteAddr

func (this *ManagedConnection) RemoteAddr() net.Addr

func (*ManagedConnection) SetDeadline

func (this *ManagedConnection) SetDeadline(t time.Time) error

func (*ManagedConnection) SetReadDeadline

func (this *ManagedConnection) SetReadDeadline(t time.Time) error

func (*ManagedConnection) SetReadTimeout

func (this *ManagedConnection) SetReadTimeout(d time.Duration) error

func (*ManagedConnection) SetTimeout

func (this *ManagedConnection) SetTimeout(d time.Duration) error

func (*ManagedConnection) SetWriteDeadline

func (this *ManagedConnection) SetWriteDeadline(t time.Time) error

func (*ManagedConnection) SetWriteTimeout

func (this *ManagedConnection) SetWriteTimeout(d time.Duration) error

func (*ManagedConnection) Write

func (this *ManagedConnection) Write(data []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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