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

Function turnNetworkTypesForURL

gather.go:80–99  ·  view source on GitHub ↗
(url stun.URI, networkTypes []NetworkType)

Source from the content-addressed store, hash-verified

78}
79
80func turnNetworkTypesForURL(url stun.URI, networkTypes []NetworkType) []NetworkType {
81 proto := effectiveURLProtoType(url)
82 res := []NetworkType{}
83
84 for _, networkType := range configuredNetworkTypes(networkTypes) {
85 switch proto {
86 case stun.ProtoTypeUDP:
87 if networkType.IsUDP() {
88 res = append(res, networkType)
89 }
90 case stun.ProtoTypeTCP:
91 if networkType.IsTCP() {
92 res = append(res, networkType)
93 }
94 default:
95 }
96 }
97
98 return res
99}
100
101// Close a net.Conn and log if we have a failure.
102func closeConnAndLog(c io.Closer, log logging.LeveledLogger, msg string, args ...any) {

Callers 1

gatherCandidatesRelayMethod · 0.85

Calls 4

effectiveURLProtoTypeFunction · 0.85
configuredNetworkTypesFunction · 0.85
IsUDPMethod · 0.80
IsTCPMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…