sessions

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotAccepted new connection does not meet requirements
	ErrNotAccepted = errors.New("Connection not accepted")

	// ErrDupNotAllowed case when new client with existing ID connected
	ErrDupNotAllowed = errors.New("duplicate not allowed")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// Topics manager for all the client subscriptions
	TopicsMgr topicsTypes.Provider

	Persist persistenceTypes.Provider

	Systree systree.Provider

	// OnDuplicate If requested we notify if there is attempt to dup session
	OnDuplicate func(string, bool)

	NodeName string

	// The number of seconds to wait for the CONNACK message before disconnecting.
	// If not set then default to 2 seconds.
	ConnectTimeout int

	// The number of seconds to keep the connection live if there's no data.
	// If not set then defaults to 5 minutes.
	KeepAlive int

	// AllowDuplicates Either allow or deny replacing of existing session if there new client with same clientID
	AllowDuplicates bool

	OfflineQoS0 bool
}

Config manager configuration

type Manager

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

Manager interface

func New

func New(cfg Config) (*Manager, error)

New alloc new

func (*Manager) Shutdown

func (m *Manager) Shutdown() error

Shutdown manager

func (*Manager) Start

func (m *Manager) Start(msg *message.ConnectMessage, resp *message.ConnAckMessage, conn net.Conn)

Start try start new session

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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