network

package
v1.0.0-beta24 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2020 License: Apache-2.0, BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ManagedConnectionCaller

func ManagedConnectionCaller(handler interface{}, params ...interface{})

Types

type ManagedConnection

type ManagedConnection struct {
	net.Conn
	Events ManagedConnectionEvents
	// contains filtered or unexported fields
}

ManagedConnection provides a wrapper for a net.Conn to be used together with events.

func NewManagedConnection

func NewManagedConnection(conn net.Conn) *ManagedConnection

func (*ManagedConnection) BytesRead

func (mc *ManagedConnection) BytesRead() uint64

BytesRead returns the total number of bytes read.

func (*ManagedConnection) BytesWritten

func (mc *ManagedConnection) BytesWritten() uint64

BytesWritten returns the total number of bytes written.

func (*ManagedConnection) Close

func (mc *ManagedConnection) Close() (err error)

Close closes the connection. Any blocked Read or Write operations will be unblocked and return errors.

func (*ManagedConnection) Read

func (mc *ManagedConnection) Read(p []byte) (int, error)

func (*ManagedConnection) SetReadTimeout

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

func (*ManagedConnection) SetTimeout

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

func (*ManagedConnection) SetWriteTimeout

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

func (*ManagedConnection) Write

func (mc *ManagedConnection) Write(p []byte) (int, error)

type ManagedConnectionEvents

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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