Skip to main content

Overview

The NetworkType enum represents the combination of transport protocol (UDP or TCP) and IP version (IPv4 or IPv6) used for ICE candidates.

Type Definition

Types

NetworkTypeUDP4

UDP over IPv4. This is the most common network type for ICE.

NetworkTypeUDP6

UDP over IPv6.

NetworkTypeTCP4

TCP over IPv4. Used for ICE-TCP.

NetworkTypeTCP6

TCP over IPv6. Used for ICE-TCP.

Methods

String

Returns the string representation of the network type. Returns:
  • "udp4" for NetworkTypeUDP4
  • "udp6" for NetworkTypeUDP6
  • "tcp4" for NetworkTypeTCP4
  • "tcp6" for NetworkTypeTCP6

NetworkShort

Returns the short protocol name without IP version. Returns:
  • "udp" for UDP types
  • "tcp" for TCP types

IsUDP

Returns true if the network type uses UDP (UDP4 or UDP6).

IsTCP

Returns true if the network type uses TCP (TCP4 or TCP6).

IsIPv4

Returns true if the network type uses IPv4 (UDP4 or TCP4).

IsIPv6

Returns true if the network type uses IPv6 (UDP6 or TCP6).

IsReliable

Returns true if the transport is reliable (TCP). Returns:
  • true for TCP types
  • false for UDP types

Usage Examples

Default Behavior

When no network types are specified, all four types are enabled by default:

ICE-TCP Considerations

When using TCP network types, you may need to configure TCP-specific options:

Filtering Network Types

You can also filter at the IP level:

Address Rewrite Rules

Network types can be used to scope address rewrite rules:

Matrix of Characteristics