turn

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 27 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PeerSignalCh - channel to recieve peer signals
	PeerSignalCh = make(chan nm_models.Signal, 50)
	// PeerConnectionCheckInterval - time interval to check peer connection status
	PeerConnectionCheckInterval = time.Minute
	// LastHandShakeThreshold - threshold for considering inactive connection
	LastHandShakeThreshold = time.Minute * 3
)

Functions

func DissolvePeerConnections added in v0.20.0

func DissolvePeerConnections()

DissolvePeerConnections - notifies all peers to disconnect from using turn.

func Init

func Init(ctx context.Context, wg *sync.WaitGroup, turnCfgs []ncconfig.TurnConfig)

Init - start's the turn client for all the present turn configs

func ShouldUseTurn

func ShouldUseTurn(natType string) bool

ShouldUseTurn - checks the nat type to check if peer needs to use turn for communication

func SignalPeer

func SignalPeer(serverName string, signal nm_models.Signal) error

SignalPeer - signals the peer with host's turn relay endpoint

func WatchPeerConnections added in v0.20.0

func WatchPeerConnections(ctx context.Context, waitg *sync.WaitGroup)

WatchPeerConnections - periodically watches peer connections. if connection is bad, host will signal peers to use turn

func WatchPeerSignals

func WatchPeerSignals(ctx context.Context, wg *sync.WaitGroup)

WatchPeerSignals - processes the peer signals for any turn updates from peers

Types

This section is empty.

Jump to

Keyboard shortcuts

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