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

Method Extensions

candidate_base.go:612–631  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

610}
611
612func (c *candidateBase) Extensions() []CandidateExtension {
613 tcpType := c.TCPType()
614 hasTCPType := 0
615 if tcpType != TCPTypeUnspecified {
616 hasTCPType = 1
617 }
618
619 extensions := make([]CandidateExtension, len(c.extensions)+hasTCPType)
620 // We store the TCPType in c.tcpType, but we need to return it as an extension.
621 if hasTCPType == 1 {
622 extensions[0] = CandidateExtension{
623 Key: "tcptype",
624 Value: tcpType.String(),
625 }
626 }
627
628 copy(extensions[hasTCPType:], c.extensions)
629
630 return extensions
631}
632
633// Get returns the value of the given key if it exists.
634func (c *candidateBase) GetExtension(key string) (CandidateExtension, bool) {

Callers 1

marshalExtensionsMethod · 0.95

Calls 2

TCPTypeMethod · 0.95
StringMethod · 0.65

Tested by

no test coverage detected