listener

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Listener

type Listener interface {
	// Accept waits for and returns the next connection to the listener.
	Accept() (connection.Connection, error)

	// Close closes the listener.
	// Any blocked Accept operations will be unblocked and return errors.
	Close() error

	// Addr returns the listener's network address.
	Addr() net.Addr

	// FD returns the listener's fd
	FD() int
}

Listener A Listener is a generic network listener for stream-oriented protocols.

type TcpListener

type TcpListener struct {
	Fd      int
	TcpAddr *net.TCPAddr
}

TcpListener tcp network listener.

func (*TcpListener) Accept

func (t *TcpListener) Accept() (connection.Connection, error)

Accept implements Listener.

func (*TcpListener) Addr

func (t *TcpListener) Addr() net.Addr

Addr implements Listener.

func (*TcpListener) Close

func (t *TcpListener) Close() error

Close implements Listener.

func (*TcpListener) FD

func (t *TcpListener) FD() int

FD implements Listener.

Jump to

Keyboard shortcuts

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