nettool

package
v17.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenConfigWithOSTCPKeepAlive

func ListenConfigWithOSTCPKeepAlive() *net.ListenConfig

ListenConfigWithOSTCPKeepAlive return a net.ListeConfig with OS-level KeepAlive settings.

func ListenWithOSTCPKeepAlive

func ListenWithOSTCPKeepAlive(network, address string) (net.Listener, error)

func TLSListenWithOSTCPKeepAlive

func TLSListenWithOSTCPKeepAlive(network, laddr string, config *tls.Config) (net.Listener, error)

Types

type ConnectionSet added in v17.5.0

type ConnectionSet interface {
	Set(connID int64) error
	Unset(connID int64) error
	GC(context.Context) error
}

type ListenerMetrics added in v17.5.0

type ListenerMetrics struct {
	Log      *slog.Logger
	NewSet   NewConnectionSet
	GCPeriod time.Duration
	ErrRep   errz.ErrReporter
	// contains filtered or unexported fields
}

func (*ListenerMetrics) RunGC added in v17.5.0

func (m *ListenerMetrics) RunGC(ctx context.Context)

func (*ListenerMetrics) Wrap added in v17.5.0

func (m *ListenerMetrics) Wrap(l net.Listener, name string, ttl time.Duration) (net.Listener, error)

Wrap wraps the provided listener. Can be called concurrently.

type NewConnectionSet added in v17.5.0

type NewConnectionSet func(name string, ttl time.Duration) (ConnectionSet, error)

type OnceCloseListener added in v17.5.0

type OnceCloseListener struct {
	net.Listener
	// contains filtered or unexported fields
}

OnceCloseListener wraps a net.Listener, protecting it from multiple Close calls.

func (*OnceCloseListener) Close added in v17.5.0

func (oc *OnceCloseListener) Close() error

Jump to

Keyboard shortcuts

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