Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrFailed = errors.New("ice: connection failed")
)
Functions ¶
func NewPacketConn ¶
NewPacketConn 从 ICE 连接构造 PacketConn 与对端地址。
Types ¶
type CandidatePairInfo ¶
type CandidatePairInfo struct {
LocalType string
RemoteType string
LocalAddr string
RemoteAddr string
}
CandidatePairInfo ICE 选路摘要。
func SelectedPairInfo ¶
func SelectedPairInfo(agent *pionice.Agent) (CandidatePairInfo, bool)
SelectedPairInfo 从 agent 读取选路摘要。
type Config ¶
type Config struct {
STUNURLs []string
TURNURL string
TURNUser string
TURNPass string
ICETimeout time.Duration
AuthToken string
}
Config ICE 客户端配置。
type Connection ¶
type Connection struct {
ICE *pionice.Conn
Agent *pionice.Agent
RemotePeerID string
ConnectDuration time.Duration
}
Connection ICE 协商结果(保留 Agent 以便读取选路与关闭资源)。
type LivePairStats ¶
type LivePairStats struct {
Pair CandidatePairInfo
RTTMs float64
PairState string
Nominated bool
}
LivePairStats 从仍存活的 ICE Agent 读取选路与 RTT(供 debug / metrics)。
func LivePairStatsFromAgent ¶
func LivePairStatsFromAgent(agent *pionice.Agent) (LivePairStats, bool)
LivePairStatsFromAgent 读取当前选中候选对的实时统计;agent 为 nil 或无选路时返回 false。
Click to show internal directories.
Click to hide internal directories.