Browse Source

Updated doc

Paul-Louis Ageneau 2 years ago
parent
commit
34e64e1d18
2 changed files with 70 additions and 10 deletions
  1. 35 5
      DOC.md
  2. 35 5
      pages/content/pages/reference.md

+ 35 - 5
DOC.md

@@ -120,13 +120,27 @@ The `proxyServer` URI, if present, must match the format `[("http"|"socks5") (":
 
 
 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".
 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".
 
 
+#### rtcClosePeerConnection
+
+```
+int rtcClosePeerConnection(int pc)
+```
+
+Closes the Peer Connection.
+
+Arguments:
+
+- `pc`: the Peer Connection identifier
+
+Return value: `RTC_ERR_SUCCESS` or a negative error code
+
 #### rtcDeletePeerConnection
 #### rtcDeletePeerConnection
 
 
 ```
 ```
 int rtcDeletePeerConnection(int pc)
 int rtcDeletePeerConnection(int pc)
 ```
 ```
 
 
-Deletes the specified Peer Connection.
+Deletes the Peer Connection.
 
 
 Arguments:
 Arguments:
 
 
@@ -134,7 +148,7 @@ Arguments:
 
 
 Return value: `RTC_ERR_SUCCESS` or a negative error code
 Return value: `RTC_ERR_SUCCESS` or a negative error code
 
 
-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.
+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.
 
 
 #### rtcSetXCallback
 #### rtcSetXCallback
 
 
@@ -463,6 +477,22 @@ Return value: `RTC_ERR_SUCCESS` or a negative error code
 
 
 WebSocket: Like with the JavaScript API, the state will first change to closing, then closed only after the connection has been actually closed.
 WebSocket: Like with the JavaScript API, the state will first change to closing, then closed only after the connection has been actually closed.
 
 
+#### rtcDelete
+
+```
+int rtcDelete(int id)
+```
+
+Deletes the channel.
+
+Arguments:
+
+- `id`: the channel identifier
+
+Return value: `RTC_ERR_SUCCESS` or a negative error code
+
+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.
+
 #### rtcIsOpen
 #### rtcIsOpen
 
 
 ```
 ```
@@ -595,7 +625,7 @@ Arguments:
 
 
 Return value: the identifier of the new Data Channel or a negative error code.
 Return value: the identifier of the new Data Channel or a negative error code.
 
 
-The Data Channel must be deleted with `rtcDeleteDataChannel`.
+The Data Channel must be deleted with `rtcDeleteDataChannel` (or `rtcDelete`).
 
 
 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.
 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.
 
 
@@ -695,7 +725,7 @@ Arguments:
 
 
 Return value: the identifier of the new Track or a negative error code
 Return value: the identifier of the new Track or a negative error code
 
 
-The new track must be deleted with `rtcDeleteTrack`.
+The new track must be deleted with `rtcDeleteTrack` (or `rtcDelete`).
 
 
 The user must call `rtcSetLocalDescription` to negotiate the track.
 The user must call `rtcSetLocalDescription` to negotiate the track.
 
 
@@ -799,7 +829,7 @@ Arguments:
 
 
 Return value: the identifier of the new WebSocket or a negative error code
 Return value: the identifier of the new WebSocket or a negative error code
 
 
-The new WebSocket must be deleted with `rtcDeleteWebSocket`. The scheme of the URL must be either `ws` or `wss`.
+The new WebSocket must be deleted with `rtcDeleteWebSocket` (or `rtcDelete`). The scheme of the URL must be either `ws` or `wss`.
 
 
 #### rtcDeleteWebSocket
 #### rtcDeleteWebSocket
 
 

+ 35 - 5
pages/content/pages/reference.md

@@ -123,13 +123,27 @@ The `proxyServer` URI, if present, must match the format `[("http"|"socks5") (":
 
 
 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".
 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".
 
 
+#### rtcClosePeerConnection
+
+```
+int rtcClosePeerConnection(int pc)
+```
+
+Closes the Peer Connection.
+
+Arguments:
+
+- `pc`: the Peer Connection identifier
+
+Return value: `RTC_ERR_SUCCESS` or a negative error code
+
 #### rtcDeletePeerConnection
 #### rtcDeletePeerConnection
 
 
 ```
 ```
 int rtcDeletePeerConnection(int pc)
 int rtcDeletePeerConnection(int pc)
 ```
 ```
 
 
-Deletes the specified Peer Connection.
+Deletes the Peer Connection.
 
 
 Arguments:
 Arguments:
 
 
@@ -137,7 +151,7 @@ Arguments:
 
 
 Return value: `RTC_ERR_SUCCESS` or a negative error code
 Return value: `RTC_ERR_SUCCESS` or a negative error code
 
 
-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.
+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.
 
 
 #### rtcSetXCallback
 #### rtcSetXCallback
 
 
@@ -466,6 +480,22 @@ Return value: `RTC_ERR_SUCCESS` or a negative error code
 
 
 WebSocket: Like with the JavaScript API, the state will first change to closing, then closed only after the connection has been actually closed.
 WebSocket: Like with the JavaScript API, the state will first change to closing, then closed only after the connection has been actually closed.
 
 
+#### rtcDelete
+
+```
+int rtcDelete(int id)
+```
+
+Deletes the channel.
+
+Arguments:
+
+- `id`: the channel identifier
+
+Return value: `RTC_ERR_SUCCESS` or a negative error code
+
+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.
+
 #### rtcIsOpen
 #### rtcIsOpen
 
 
 ```
 ```
@@ -598,7 +628,7 @@ Arguments:
 
 
 Return value: the identifier of the new Data Channel or a negative error code.
 Return value: the identifier of the new Data Channel or a negative error code.
 
 
-The Data Channel must be deleted with `rtcDeleteDataChannel`.
+The Data Channel must be deleted with `rtcDeleteDataChannel` (or `rtcDelete`).
 
 
 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.
 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.
 
 
@@ -698,7 +728,7 @@ Arguments:
 
 
 Return value: the identifier of the new Track or a negative error code
 Return value: the identifier of the new Track or a negative error code
 
 
-The new track must be deleted with `rtcDeleteTrack`.
+The new track must be deleted with `rtcDeleteTrack` (or `rtcDelete`).
 
 
 The user must call `rtcSetLocalDescription` to negotiate the track.
 The user must call `rtcSetLocalDescription` to negotiate the track.
 
 
@@ -802,7 +832,7 @@ Arguments:
 
 
 Return value: the identifier of the new WebSocket or a negative error code
 Return value: the identifier of the new WebSocket or a negative error code
 
 
-The new WebSocket must be deleted with `rtcDeleteWebSocket`. The scheme of the URL must be either `ws` or `wss`.
+The new WebSocket must be deleted with `rtcDeleteWebSocket` (or `rtcDelete`). The scheme of the URL must be either `ws` or `wss`.
 
 
 #### rtcDeleteWebSocket
 #### rtcDeleteWebSocket