Source File
candidate.go
Belonging Package
github.com/pion/ice/v4
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage iceimport ()const (receiveMTU = 8192defaultLocalPreference = 65535// ComponentRTP indicates that the candidate is used for RTP.ComponentRTP uint16 = 1// ComponentRTCP indicates that the candidate is used for RTCP.ComponentRTCP)// Candidate represents an ICE candidate.type Candidate interface {// An arbitrary string used in the freezing algorithm to// group similar candidates. It is the same for two candidates that// have the same type, base IP address, protocol (UDP, TCP, etc.),// and STUN or TURN server.Foundation() string// ID is a unique identifier for just this candidate// Unlike the foundation this is different for each candidateID() string// A component is a piece of a data stream.// An example is one for RTP, and one for RTCPComponent() uint16SetComponent(uint16)// The last time this candidate received trafficLastReceived() time.Time// The last time this candidate sent trafficLastSent() time.TimeNetworkType() NetworkTypeAddress() stringPort() intPriority() uint32// A transport address related to a// candidate, which is useful for diagnostics and other purposesRelatedAddress() *CandidateRelatedAddress// Extensions returns a copy of all extension attributes associated with the ICECandidate.// In the order of insertion, *(key value).// Extension attributes are defined in RFC 5245, Section 15.1:// https://datatracker.ietf.org/doc/html/rfc5245#section-15.1//.Extensions() []CandidateExtension// GetExtension returns the value of the extension attribute associated with the ICECandidate.// Extension attributes are defined in RFC 5245, Section 15.1:// https://datatracker.ietf.org/doc/html/rfc5245#section-15.1//.GetExtension(key string) (value CandidateExtension, ok bool)// AddExtension adds an extension attribute to the ICECandidate.// If an extension with the same key already exists, it will be overwritten.// Extension attributes are defined in RFC 5245, Section 15.1:AddExtension(extension CandidateExtension) error// RemoveExtension removes an extension attribute from the ICECandidate.// Extension attributes are defined in RFC 5245, Section 15.1:RemoveExtension(key string) (ok bool)String() stringType() CandidateTypeTCPType() TCPTypeEqual(other Candidate) bool// DeepEqual same as Equal, But it also compares the candidate extensions.DeepEqual(other Candidate) boolMarshal() stringaddr() net.AddrfilterForLocationTracking() boolagent() *Agentcontext() context.Contextclose() errorcopy() (Candidate, error)seen(outbound bool)start(a *Agent, conn net.PacketConn, initializedCh <-chan struct{})writeTo(raw []byte, dst Candidate) (int, error)}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |