1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! ICE error event types.
//!
//! Contains error information emitted when ICE candidate gathering fails.
/// ICE candidate gathering error event.
///
/// This event provides detailed information about errors that occur during
/// ICE candidate gathering, such as STUN/TURN server failures, network issues,
/// or permission problems.
///
/// # Fields
///
/// - `address` - Host candidate's related address (may be empty)
/// - `port` - Host candidate's related port
/// - `url` - STUN or TURN URL that caused the error
/// - `error_code` - Numeric error code
/// - `error_text` - Human-readable error description
///
/// # Common Error Codes
///
/// - `701` - STUN/TURN server unreachable
/// - `702` - TURN authentication failed
/// - `703` - TURN allocation failed
/// - `710` - Network permission denied
///
/// # Examples
///
/// ```
/// use rtc::peer_connection::event::RTCPeerConnectionEvent;
///
/// # fn handle_event(event: RTCPeerConnectionEvent) {
/// match event {
/// RTCPeerConnectionEvent::OnIceCandidateErrorEvent(error) => {
/// eprintln!(
/// "ICE gathering error {}: {} (URL: {})",
/// error.error_code, error.error_text, error.url
/// );
///
/// // Handle specific error codes
/// match error.error_code {
/// 701 => eprintln!("STUN/TURN server unreachable"),
/// 702 => eprintln!("TURN authentication failed - check credentials"),
/// _ => {}
/// }
/// }
/// _ => {}
/// }
/// # }
/// ```
///
/// # Specification
///
/// See [RTCPeerConnectionIceErrorEvent](https://www.w3.org/TR/webrtc/#rtcpeerconnectioniceerrorevent)