listener

package
v0.2.37 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// The probing interval for publisher to check the publish status.
	// This is required in case discovery server does not send close signal.
	DiscoveryClientPingInterval = time.Minute
	// The dynamic address detection cycle.
	// MultiListener will close the listener whose associated urls are changed.
	DynamicAddressStateMonitorInterval = time.Minute

	ErrNoListenerConfigured = fmt.Errorf("url must contain port= or relay=1 field")

	SessionMinRetryDuration = time.Second
	SessionMaxRetryDuration = time.Minute
)

Functions

func CreateDirectListener

func CreateDirectListener(Context context.Context, URL *url.URL, config *ListenerConfig) (net.Listener, []url.URL, error)

RegisterURLListener creates a listener on the given URL. This URL can only be TCP or UDP for direct access cases. Append query `enc=1` for e2e encryption (Only works on TCP).

Types

type DynamicAddressGetter added in v0.2.30

type DynamicAddressGetter = func() ([]url.URL, error)

type ListenerConfig

type ListenerConfig struct {
	IdleUDPTimeout time.Duration
	XConfig        *xconn.Config

	// This will cause receiver returns merged packets.
	GSOGROOptimization bool
}

type MultiLis added in v0.2.17

type MultiLis struct {
	// contains filtered or unexported fields
}

func New

func New(Context context.Context) *MultiLis

func (*MultiLis) Accept added in v0.2.17

func (l *MultiLis) Accept() (net.Conn, error)

func (*MultiLis) Addr added in v0.2.17

func (l *MultiLis) Addr() net.Addr

func (*MultiLis) Close added in v0.2.17

func (l *MultiLis) Close() error

func (*MultiLis) RegisterChannel added in v0.2.17

func (l *MultiLis) RegisterChannel(channel string, discoveryDialer func() (net.Conn, error))

func (*MultiLis) RegisterListener added in v0.2.17

func (l *MultiLis) RegisterListener(alias string, listenerCreator func() (net.Listener, []url.URL, error), dynamicAddressGetter func() ([]url.URL, error))

func (*MultiLis) URLs added in v0.2.17

func (l *MultiLis) URLs() []url.URL

Jump to

Keyboard shortcuts

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