listener

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2025 License: MIT Imports: 21 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

	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.

Types

type DynamicAddressGetter

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

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

func New

func New(Context context.Context) *MultiLis

func (*MultiLis) Accept

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

func (*MultiLis) Addr

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

func (*MultiLis) Close

func (l *MultiLis) Close() error

func (*MultiLis) RegisterChannel

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

func (*MultiLis) RegisterListener

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

func (*MultiLis) URLs

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

Source Files

  • listener.go
  • listener_url.go

Jump to

Keyboard shortcuts

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