network

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2018 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NewDataChannel int = iota + 1
	NewMessage
)

Enums for DataChannelEventType

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferTransportGenerator

type BufferTransportGenerator func(uint32, uint8) *TransportPair

BufferTransportGenerator generates a new channel for the associated SSRC This channel is used to send RTP and RTCP packets to users of pion-WebRTC

type DataChannelCreated added in v1.1.0

type DataChannelCreated struct {
	Label string
	// contains filtered or unexported fields
}

DataChannelCreated is emitted when a new DataChannel is created

func (*DataChannelCreated) StreamIdentifier added in v1.1.0

func (d *DataChannelCreated) StreamIdentifier() uint16

StreamIdentifier returns the streamIdentifier

type DataChannelEvent added in v1.1.0

type DataChannelEvent interface {
	StreamIdentifier() uint16
}

DataChannelEvent is the interface for all events that flow across the DataChannelEventHandler

type DataChannelEventHandler added in v1.1.0

type DataChannelEventHandler func(DataChannelEvent)

DataChannelEventHandler notifies the RTCPeerConnection of events relating to DataChannels

type DataChannelEventType added in v1.1.0

type DataChannelEventType int

DataChannelEventType is the enum used to represent different types of DataChannelEvent

type DataChannelMessage added in v1.1.0

type DataChannelMessage struct {
	Payload datachannel.Payload
	// contains filtered or unexported fields
}

DataChannelMessage is emitted when a DataChannel receives a message

func (*DataChannelMessage) StreamIdentifier added in v1.1.0

func (d *DataChannelMessage) StreamIdentifier() uint16

StreamIdentifier returns the streamIdentifier

type DataChannelOpen added in v1.1.0

type DataChannelOpen struct{}

DataChannelOpen is emitted when all channels should be opened

func (*DataChannelOpen) StreamIdentifier added in v1.1.0

func (d *DataChannelOpen) StreamIdentifier() uint16

StreamIdentifier returns the streamIdentifier

type ICENotifier

type ICENotifier func(ice.ConnectionState)

ICENotifier notifies the RTCPeerConnection if ICE state has changed

type Manager added in v1.1.0

type Manager struct {
	IceAgent *ice.Agent
	// contains filtered or unexported fields
}

Manager contains all network state (DTLS, SRTP) that is shared between ports It is also used to perform operations that involve multiple ports

func NewManager added in v1.1.0

func NewManager(urls []*ice.URL, btg BufferTransportGenerator, ntf ICENotifier) *Manager

NewManager creates a new network.Manager

func (*Manager) AcceptDataChannel added in v1.2.0

func (m *Manager) AcceptDataChannel() (*datachannel.DataChannel, error)

AcceptDataChannel is used to accept incoming data channels TODO: Move to RTCSctpTransport

func (*Manager) AddTransportPair added in v1.2.0

func (m *Manager) AddTransportPair(ssrc uint32, Rtp chan<- *rtp.Packet, Rtcp chan<- rtcp.Packet)

AddTransportPair notifies the network manager that an RTCTrack has been created externally, and packets may be incoming with this ssrc

func (*Manager) Close added in v1.1.0

func (m *Manager) Close() error

Close cleans up all the allocated state

func (*Manager) CreateContextSRTP added in v1.2.0

func (m *Manager) CreateContextSRTP(keyingMaterial []byte, isOffer bool) error

CreateContextSRTP takes the exported keying material from DTLS and creates Client/Server contexts

func (*Manager) OpenDataChannel added in v1.2.0

func (m *Manager) OpenDataChannel(id uint16, config *datachannel.Config) (*datachannel.DataChannel, error)

OpenDataChannel is used to open a data channel TODO: Move to RTCSctpTransport

func (*Manager) SendRTCP added in v1.1.0

func (m *Manager) SendRTCP(pkt []byte)

SendRTCP finds a connected port and sends the passed RTCP packet

func (*Manager) SendRTP added in v1.1.0

func (m *Manager) SendRTP(packet *rtp.Packet)

SendRTP finds a connected port and sends the passed RTP packet

func (*Manager) Start added in v1.1.0

func (m *Manager) Start(isOffer bool,
	remoteUfrag, remotePwd string,
	dtlsCert *x509.Certificate, dtlsPrivKey crypto.PrivateKey, fingerprint, fingerprintHash string) error

Start allocates the network stack TODO: Turn into the ORTC constructors

type TransportPair added in v1.2.0

type TransportPair struct {
	RTP  chan<- *rtp.Packet
	RTCP chan<- rtcp.Packet
}

TransportPair allows the application to be notified about both Rtp and Rtcp messages incoming from the remote host

Jump to

Keyboard shortcuts

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