ice

package
v0.0.0-...-61b8474 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectionStateNew          = epdiscproto.ConnectionState_NEW
	ConnectionStateChecking     = epdiscproto.ConnectionState_CHECKING
	ConnectionStateConnected    = epdiscproto.ConnectionState_CONNECTED
	ConnectionStateCompleted    = epdiscproto.ConnectionState_COMPLETED
	ConnectionStateFailed       = epdiscproto.ConnectionState_FAILED
	ConnectionStateDisconnected = epdiscproto.ConnectionState_DISCONNECTED
	ConnectionStateClosed       = epdiscproto.ConnectionState_CLOSED
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionState

type ConnectionState = epdiscproto.ConnectionState
const (
	ConnectionStateConnecting ConnectionState = 100 + iota
	ConnectionStateClosing
	ConnectionStateCreating
	ConnectionStateRestarting
	ConnectionStateIdle
	ConnectionStateGathering
	ConnectionStateGatheringLocal  // After first remote candidate has been received
	ConnectionStateGatheringRemote // After first local candidate has been received
)

The following connection states are an extension to the states by the ICE RFC in order to mitigate race conditions when handling the pion/ice.Agent. They are mainly used for transitioning between the states above.

type Peer

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

Peer 封装了 Pion ICE Agent 以简化点对点连接的建立

func NewICEAgentWrapper

func NewICEAgentWrapper(
	logger *zap.Logger,
	signalingClient signal.Client,
	stunServer []string,
	source string,
	target string,
) (*Peer, error)

NewICEAgentWrapper 创建并返回一个新的 Peer

func (*Peer) AddRemoteCandidate

func (p *Peer) AddRemoteCandidate(c *ice.Candidate) error

AddRemoteCandidate 添加远程候选者

func (*Peer) Close

func (p *Peer) Close() error

Close 关闭 ICE Agent

func (*Peer) IsControlling

func (p *Peer) IsControlling() bool

func (*Peer) Restart

func (p *Peer) Restart() error

Restart the ICE agent by creating a new one

func (*Peer) Start

func (p *Peer) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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