Source File
candidatetype.go
Belonging Package
github.com/pion/ice/v4
// SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>// SPDX-License-Identifier: MITpackage ice// CandidateType represents the type of candidate.type CandidateType byte// CandidateType enum.const (CandidateTypeUnspecified CandidateType = iotaCandidateTypeHostCandidateTypeServerReflexiveCandidateTypePeerReflexiveCandidateTypeRelay)// String makes CandidateType printable.func ( CandidateType) () string {switch {case CandidateTypeHost:return "host"case CandidateTypeServerReflexive:return "srflx"case CandidateTypePeerReflexive:return "prflx"case CandidateTypeRelay:return "relay"case CandidateTypeUnspecified:return "Unknown candidate type"}return "Unknown candidate type"}// Preference returns the preference weight of a CandidateType//// 4.1.2.2. Guidelines for Choosing Type and Local Preferences// The RECOMMENDED values are 126 for host candidates, 100// for server reflexive candidates, 110 for peer reflexive candidates,// and 0 for relayed candidates.func ( CandidateType) () uint16 {switch {case CandidateTypeHost:return 126case CandidateTypePeerReflexive:return 110case CandidateTypeServerReflexive:return 100case CandidateTypeRelay, CandidateTypeUnspecified:return 0}return 0}func containsCandidateType( CandidateType, []CandidateType) bool {if == nil {return false}for , := range {if == {return true}}return false}
![]() |
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. |