WebRTC ICE Candidate Pair (icecandidatepair.go)

webrtc · icecandidatepair.go · go · MIT
realtime, infra, lang:go

Represents and manages ICE candidate pairs for WebRTC connections. Use this to handle network path statistics and connectivity state in real-time communication.

// Source: https://github.com/pion/webrtc | License: MIT | Copyright 2026 The Pion community <https://pion.ly>
// Provided via justclaw.it.com; keep this notice with the code.
// SPDX-FileCopyrightText: 2026 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT

package webrtc

import "fmt"

// ICECandidatePair represents an ICE Candidate pair.
type ICECandidatePair struct {
	statsID string
	Local   *ICECandidate
	Remote  *ICECandidate
}

func newICECandidatePairStatsID(localID, remoteID string) string {
	return fmt.Sprintf("%s-%s", localID, remoteID)
}

func (p *ICECandidatePair) String() string {
	if p == nil {
		return "<nil>"
	}

	return fmt.Sprintf("(local) %s <-> (remote) %s", p.Local, p.Remote)
}

// NewICECandidatePair returns an initialized *ICECandidatePair
// for 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key