MCPcopy Create free account
hub / github.com/pion/ice / TypePreference

Method TypePreference

candidate_base.go:429–445  ·  view source on GitHub ↗

TypePreference returns the type preference for this candidate.

()

Source from the content-addressed store, hash-verified

427
428// TypePreference returns the type preference for this candidate.
429func (c *candidateBase) TypePreference() uint16 {
430 pref := c.Type().Preference()
431 if pref == 0 {
432 return 0
433 }
434
435 if c.NetworkType().IsTCP() {
436 var tcpPriorityOffset uint16 = defaultTCPPriorityOffset
437 if c.agent() != nil {
438 tcpPriorityOffset = c.agent().tcpPriorityOffset
439 }
440
441 pref -= tcpPriorityOffset
442 }
443
444 return pref
445}
446
447// Priority computes the priority for this ICE Candidate
448// See: https://www.rfc-editor.org/rfc/rfc8445#section-5.1.2.1

Callers 2

PriorityMethod · 0.95

Calls 5

TypeMethod · 0.95
NetworkTypeMethod · 0.95
agentMethod · 0.95
PreferenceMethod · 0.80
IsTCPMethod · 0.80

Tested by 1