Priority computes the priority for this ICE Candidate See: https://www.rfc-editor.org/rfc/rfc8445#section-5.1.2.1
()
| 447 | // Priority computes the priority for this ICE Candidate |
| 448 | // See: https://www.rfc-editor.org/rfc/rfc8445#section-5.1.2.1 |
| 449 | func (c *candidateBase) Priority() uint32 { |
| 450 | if c.priorityOverride != 0 { |
| 451 | return c.priorityOverride |
| 452 | } |
| 453 | |
| 454 | // The local preference MUST be an integer from 0 (lowest preference) to |
| 455 | // 65535 (highest preference) inclusive. When there is only a single IP |
| 456 | // address, this value SHOULD be set to 65535. If there are multiple |
| 457 | // candidates for a particular component for a particular data stream |
| 458 | // that have the same type, the local preference MUST be unique for each |
| 459 | // one. |
| 460 | |
| 461 | return (1<<24)*uint32(c.TypePreference()) + |
| 462 | (1<<8)*uint32(c.LocalPreference()) + |
| 463 | (1<<0)*uint32(256-c.Component()) |
| 464 | } |
| 465 | |
| 466 | // transportAddressEqual checks if the transport address (IP, Port, NetworkType, TCPType) is equal to another |
| 467 | // candidate. |
no test coverage detected