xep0114

package
v0.62.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListenerConfig added in v0.55.0

type ListenerConfig struct {
	// BindAddr defines listener incoming connections address.
	BindAddr string `fig:"bind_addr"`

	// Port defines listener incoming connections port.
	Port int `fig:"port" default:"5275"`

	// ConnectTimeout defines connection timeout.
	ConnectTimeout time.Duration

	// KeepAliveTimeout defines the maximum amount of time that an inactive connection
	// would be considered alive.
	KeepAliveTimeout time.Duration

	// RequestTimeout defines component stream request timeout.
	RequestTimeout time.Duration

	// MaxStanzaSize is the maximum size a listener incoming stanza may have.
	MaxStanzaSize int
}

ListenerConfig defines component connection configuration.

type ListenersConfig added in v0.55.0

type ListenersConfig []ListenerConfig

ListenersConfig defines a set of component listener configurations.

type SocketListener

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

SocketListener represents a component socket listener type.

func NewListeners added in v0.55.0

func NewListeners(
	cfg ListenersConfig,
	secretKey string,
	hosts *host.Hosts,
	comps *component.Components,
	extCompMng *extcomponentmanager.Manager,
	router router.Router,
	shapers shaper.Shapers,
	hk *hook.Hooks,
	logger kitlog.Logger,
) []*SocketListener

NewListeners creates and initializes a set of component listeners based of cfg configuration.

func (*SocketListener) Start

func (l *SocketListener) Start(ctx context.Context) error

Start starts listening on the TCP network address bindAddr to handle incoming connections.

func (*SocketListener) Stop

func (l *SocketListener) Stop(ctx context.Context) error

Stop stops handling incoming connections and closes underlying TCP listener.

Jump to

Keyboard shortcuts

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