Skip to content

Commit 34e64e1

Browse files
Updated doc
1 parent 7dee6fe commit 34e64e1

2 files changed

Lines changed: 70 additions & 10 deletions

File tree

DOC.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,21 +120,35 @@ The `proxyServer` URI, if present, must match the format `[("http"|"socks5") (":
120120

121121
If the username or password of an URI contains reserved special characters, they must be percent-encoded. In particular, ":" must be encoded as "%3A" and "@" must by encoded as "%40".
122122

123+
#### rtcClosePeerConnection
124+
125+
```
126+
int rtcClosePeerConnection(int pc)
127+
```
128+
129+
Closes the Peer Connection.
130+
131+
Arguments:
132+
133+
- `pc`: the Peer Connection identifier
134+
135+
Return value: `RTC_ERR_SUCCESS` or a negative error code
136+
123137
#### rtcDeletePeerConnection
124138

125139
```
126140
int rtcDeletePeerConnection(int pc)
127141
```
128142

129-
Deletes the specified Peer Connection.
143+
Deletes the Peer Connection.
130144

131145
Arguments:
132146

133147
- `pc`: the Peer Connection identifier
134148

135149
Return value: `RTC_ERR_SUCCESS` or a negative error code
136150

137-
After this function has been called, `pc` must not be used in a function call anymore. This function will block until all scheduled callbacks of `pc` return (except the one this function might be called in) and no other callback will be called for `pc` after it returns.
151+
If it is not already closed, the Peer Connection is implicitly closed before being deleted. After this function has been called, `pc` must not be used in a function call anymore. This function will block until all scheduled callbacks of `pc` return (except the one this function might be called in) and no other callback will be called for `pc` after it returns.
138152

139153
#### rtcSetXCallback
140154

@@ -463,6 +477,22 @@ Return value: `RTC_ERR_SUCCESS` or a negative error code
463477

464478
WebSocket: Like with the JavaScript API, the state will first change to closing, then closed only after the connection has been actually closed.
465479

480+
#### rtcDelete
481+
482+
```
483+
int rtcDelete(int id)
484+
```
485+
486+
Deletes the channel.
487+
488+
Arguments:
489+
490+
- `id`: the channel identifier
491+
492+
Return value: `RTC_ERR_SUCCESS` or a negative error code
493+
494+
If it is not already closed, the channel is implicitly closed before being deleted. After this function has been called, `id` must not be used in a function call anymore. This function will block until all scheduled callbacks of `id` return (except the one this function might be called in) and no other callback will be called for `id` after it returns.
495+
466496
#### rtcIsOpen
467497

468498
```
@@ -595,7 +625,7 @@ Arguments:
595625

596626
Return value: the identifier of the new Data Channel or a negative error code.
597627

598-
The Data Channel must be deleted with `rtcDeleteDataChannel`.
628+
The Data Channel must be deleted with `rtcDeleteDataChannel` (or `rtcDelete`).
599629

600630
If `disableAutoNegotiation` was not set in `rtcConfiguration`, the library will automatically initiate the negotiation by calling `rtcSetLocalDescription` internally. Otherwise, the user must call `rtcSetLocalDescription` to initiate the negotiation after creating the first Data Channel.
601631

@@ -695,7 +725,7 @@ Arguments:
695725

696726
Return value: the identifier of the new Track or a negative error code
697727

698-
The new track must be deleted with `rtcDeleteTrack`.
728+
The new track must be deleted with `rtcDeleteTrack` (or `rtcDelete`).
699729

700730
The user must call `rtcSetLocalDescription` to negotiate the track.
701731

@@ -799,7 +829,7 @@ Arguments:
799829

800830
Return value: the identifier of the new WebSocket or a negative error code
801831

802-
The new WebSocket must be deleted with `rtcDeleteWebSocket`. The scheme of the URL must be either `ws` or `wss`.
832+
The new WebSocket must be deleted with `rtcDeleteWebSocket` (or `rtcDelete`). The scheme of the URL must be either `ws` or `wss`.
803833

804834
#### rtcDeleteWebSocket
805835

pages/content/pages/reference.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,21 +123,35 @@ The `proxyServer` URI, if present, must match the format `[("http"|"socks5") (":
123123

124124
If the username or password of an URI contains reserved special characters, they must be percent-encoded. In particular, ":" must be encoded as "%3A" and "@" must by encoded as "%40".
125125

126+
#### rtcClosePeerConnection
127+
128+
```
129+
int rtcClosePeerConnection(int pc)
130+
```
131+
132+
Closes the Peer Connection.
133+
134+
Arguments:
135+
136+
- `pc`: the Peer Connection identifier
137+
138+
Return value: `RTC_ERR_SUCCESS` or a negative error code
139+
126140
#### rtcDeletePeerConnection
127141

128142
```
129143
int rtcDeletePeerConnection(int pc)
130144
```
131145

132-
Deletes the specified Peer Connection.
146+
Deletes the Peer Connection.
133147

134148
Arguments:
135149

136150
- `pc`: the Peer Connection identifier
137151

138152
Return value: `RTC_ERR_SUCCESS` or a negative error code
139153

140-
After this function has been called, `pc` must not be used in a function call anymore. This function will block until all scheduled callbacks of `pc` return (except the one this function might be called in) and no other callback will be called for `pc` after it returns.
154+
If it is not already closed, the Peer Connection is implicitly closed before being deleted. After this function has been called, `pc` must not be used in a function call anymore. This function will block until all scheduled callbacks of `pc` return (except the one this function might be called in) and no other callback will be called for `pc` after it returns.
141155

142156
#### rtcSetXCallback
143157

@@ -466,6 +480,22 @@ Return value: `RTC_ERR_SUCCESS` or a negative error code
466480

467481
WebSocket: Like with the JavaScript API, the state will first change to closing, then closed only after the connection has been actually closed.
468482

483+
#### rtcDelete
484+
485+
```
486+
int rtcDelete(int id)
487+
```
488+
489+
Deletes the channel.
490+
491+
Arguments:
492+
493+
- `id`: the channel identifier
494+
495+
Return value: `RTC_ERR_SUCCESS` or a negative error code
496+
497+
If it is not already closed, the channel is implicitly closed before being deleted. After this function has been called, `id` must not be used in a function call anymore. This function will block until all scheduled callbacks of `id` return (except the one this function might be called in) and no other callback will be called for `id` after it returns.
498+
469499
#### rtcIsOpen
470500

471501
```
@@ -598,7 +628,7 @@ Arguments:
598628

599629
Return value: the identifier of the new Data Channel or a negative error code.
600630

601-
The Data Channel must be deleted with `rtcDeleteDataChannel`.
631+
The Data Channel must be deleted with `rtcDeleteDataChannel` (or `rtcDelete`).
602632

603633
If `disableAutoNegotiation` was not set in `rtcConfiguration`, the library will automatically initiate the negotiation by calling `rtcSetLocalDescription` internally. Otherwise, the user must call `rtcSetLocalDescription` to initiate the negotiation after creating the first Data Channel.
604634

@@ -698,7 +728,7 @@ Arguments:
698728

699729
Return value: the identifier of the new Track or a negative error code
700730

701-
The new track must be deleted with `rtcDeleteTrack`.
731+
The new track must be deleted with `rtcDeleteTrack` (or `rtcDelete`).
702732

703733
The user must call `rtcSetLocalDescription` to negotiate the track.
704734

@@ -802,7 +832,7 @@ Arguments:
802832

803833
Return value: the identifier of the new WebSocket or a negative error code
804834

805-
The new WebSocket must be deleted with `rtcDeleteWebSocket`. The scheme of the URL must be either `ws` or `wss`.
835+
The new WebSocket must be deleted with `rtcDeleteWebSocket` (or `rtcDelete`). The scheme of the URL must be either `ws` or `wss`.
806836

807837
#### rtcDeleteWebSocket
808838

0 commit comments

Comments
 (0)