Add support for passive ICE TCP candidate

Closes #196
This commit is contained in:
Jerko Steiner
2020-07-04 09:49:55 +02:00
parent f287f49c89
commit 12f44e93f1
20 changed files with 907 additions and 38 deletions

View File

@@ -11,16 +11,11 @@ const (
tcp = "tcp"
)
var supportedNetworks = []string{
udp,
// tcp, // Not supported yet
}
var supportedNetworkTypes = []NetworkType{
NetworkTypeUDP4,
NetworkTypeUDP6,
// NetworkTypeTCP4, // Not supported yet
// NetworkTypeTCP6, // Not supported yet
NetworkTypeTCP4,
NetworkTypeTCP6,
}
// NetworkType represents the type of network
@@ -55,6 +50,16 @@ func (t NetworkType) String() string {
}
}
// IsUDP returns true when network is UDP4 or UDP6.
func (t NetworkType) IsUDP() bool {
return t == NetworkTypeUDP4 || t == NetworkTypeUDP6
}
// IsTCP returns true when network is TCP4 or TCP6.
func (t NetworkType) IsTCP() bool {
return t == NetworkTypeTCP4 || t == NetworkTypeTCP6
}
// NetworkShort returns the short network description
func (t NetworkType) NetworkShort() string {
switch t {