guard

package
v0.30.3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Guard

type Guard struct {
	Reconnect chan struct{}
	// contains filtered or unexported fields
}

Guard is responsible for the reconnection logic. It will trigger to send an offer to the peer then has connection issues. Watch these events: - Relay client reconnected to home server - Signal server connection state changed - ICE connection disconnected - Relayed connection disconnected - ICE candidate changes

func NewGuard

func NewGuard(log *log.Entry, isController bool, isConnectedFn isConnectedFunc, timeout time.Duration, srWatcher *SRWatcher) *Guard

func (*Guard) SetICEConnDisconnected

func (g *Guard) SetICEConnDisconnected(changed bool)

func (*Guard) SetRelayedConnDisconnected

func (g *Guard) SetRelayedConnDisconnected(changed bool)

func (*Guard) Start

func (g *Guard) Start(ctx context.Context)

type ICEMonitor

type ICEMonitor struct {
	ReconnectCh chan struct{}
	// contains filtered or unexported fields
}

func NewICEMonitor

func NewICEMonitor(iFaceDiscover stdnet.ExternalIFaceDiscover, config icemaker.Config) *ICEMonitor

func (*ICEMonitor) Start

func (cm *ICEMonitor) Start(ctx context.Context, onChanged func())

type SRWatcher

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

func NewSRWatcher

func NewSRWatcher(signalClient chNotifier, relayManager chNotifier, iFaceDiscover stdnet.ExternalIFaceDiscover, iceConfig ice.Config) *SRWatcher

NewSRWatcher creates a new SRWatcher. This watcher will notify the listeners when the ICE candidates change or the Relay connection is reconnected or the Signal client reconnected.

func (*SRWatcher) Close

func (w *SRWatcher) Close()

func (*SRWatcher) NewListener

func (w *SRWatcher) NewListener() chan struct{}

func (*SRWatcher) RemoveListener

func (w *SRWatcher) RemoveListener(listenerChan chan struct{})

func (*SRWatcher) Start

func (w *SRWatcher) Start()

Jump to

Keyboard shortcuts

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