nativeconnectivity

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: AGPL-3.0 Imports: 10 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

Overview

Package nativeconnectivity assembles the native peer transport used by application workflows. The workflow owns the returned factory's native connectivity and must stop it after its protocol sessions finish.

Index

Constants

This section is empty.

Variables

View Source
var ErrCapacityRequired = errors.New("application connectivity capacity is required")

Functions

func NewReceiver

func NewReceiver(config ReceiverConfig) (*v2peer.ReceiverFactory, error)

func NewSender

func NewSender(config SenderConfig) (*v2peer.Factory, error)

Types

type Capacity

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

Capacity belongs to one Engine, above tasks and connection generations. Keeping the authorities together prevents factory replacement from minting admission tokens while each module retains its own scheduling policy.

Sender and receiver TURN permits are isolated because a receiver holds its permit until LANE_ATTACH; sharing one pool lets four outbound receiver lines deadlock or starve the paired local sender in the same Engine.

func NewCapacity

func NewCapacity(clock nativepeer.AdmissionClock, monitor nativepeer.NetworkMonitor) *Capacity

func (*Capacity) NewNative

func (capacity *Capacity) NewNative(config nativepeer.Config) (*nativepeer.NativePeerConnectivity, error)

func (*Capacity) ReceiverTURN added in v0.1.6

func (capacity *Capacity) ReceiverTURN() *turnsession.Capacity

func (*Capacity) SenderTURN added in v0.1.6

func (capacity *Capacity) SenderTURN() *turnsession.Capacity

func (*Capacity) Sends

func (capacity *Capacity) Sends() *wsrtc.SendCapacity

type ReceiverConfig

type ReceiverConfig struct {
	Capacity       *Capacity
	Random         io.Reader
	Native         *nativepeer.NativePeerConnectivity
	Diagnostics    bool
	ObserveChannel func(*wsrtc.Channel)
}

type SenderConfig

type SenderConfig struct {
	Trace          diagnostics.Sink
	TURNProvider   turnsession.Provider
	Capacity       *Capacity
	Now            func() time.Time
	Diagnostics    bool
	ObserveChannel func(*wsrtc.Channel)
	ICEPool        func() icepolicy.ICEEndpointPool
}

Jump to

Keyboard shortcuts

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