|
@@ -405,50 +405,67 @@ int rtcSetAvailableCallback(int id, rtcAvailableCallbackFunc cb)
|
|
|
|
|
|
It is called when messages are now available to be received with `rtcReceiveMessage`.
|
|
|
|
|
|
-#### rtcIsOpen
|
|
|
+#### rtcSendMessage
|
|
|
|
|
|
```
|
|
|
-bool rtcIsOpen(int id)
|
|
|
+int rtcSendMessage(int id, const char *data, int size)
|
|
|
```
|
|
|
|
|
|
+Sends a message in the channel.
|
|
|
+
|
|
|
Arguments:
|
|
|
|
|
|
- `id`: the channel identifier
|
|
|
+- `data`: the message data
|
|
|
+- `size`: if size >= 0, `data` is interpreted as a binary message of length `size`, otherwise it is interpreted as a null-terminated UTF-8 string.
|
|
|
|
|
|
-Return value: `true` if the channel exists and is open, `false` otherwise
|
|
|
+Return value: `RTC_ERR_SUCCESS` or a negative error code
|
|
|
|
|
|
-#### rtcIsClosed
|
|
|
+The message is sent immediately if possible, otherwise it is buffered to be sent later.
|
|
|
+
|
|
|
+Data Channel and WebSocket: If the message may not be sent immediately due to flow control or congestion control, it is buffered until it can actually be sent. You can retrieve the current buffered data size with `rtcGetBufferedAmount`.
|
|
|
+
|
|
|
+Track: There is no flow or congestion control, messages are never buffered and `rtcGetBufferedAmount` always returns 0.
|
|
|
+
|
|
|
+#### rtcClose
|
|
|
|
|
|
```
|
|
|
-bool rtcIsClosed(int id)
|
|
|
+int rtcClose(int id)
|
|
|
```
|
|
|
|
|
|
+Close the channel.
|
|
|
+
|
|
|
Arguments:
|
|
|
|
|
|
- `id`: the channel identifier
|
|
|
|
|
|
-Return value: `true` if the channel exists and is closed (not open and not connecting), `false` otherwise
|
|
|
+Return value: `RTC_ERR_SUCCESS` or a negative error code
|
|
|
|
|
|
-#### rtcSendMessage
|
|
|
+WebSocket: Like with the JavaScript API, the state will first change to closing, then closed only after the connection has been actually closed.
|
|
|
+
|
|
|
+#### rtcIsOpen
|
|
|
|
|
|
```
|
|
|
-int rtcSendMessage(int id, const char *data, int size)
|
|
|
+bool rtcIsOpen(int id)
|
|
|
```
|
|
|
|
|
|
-Sends a message in the channel.
|
|
|
-
|
|
|
Arguments:
|
|
|
|
|
|
- `id`: the channel identifier
|
|
|
-- `data`: the message data
|
|
|
-- `size`: if size >= 0, `data` is interpreted as a binary message of length `size`, otherwise it is interpreted as a null-terminated UTF-8 string.
|
|
|
|
|
|
-Return value: `RTC_ERR_SUCCESS` or a negative error code
|
|
|
+Return value: `true` if the channel exists and is open, `false` otherwise
|
|
|
|
|
|
-The message is sent immediately if possible, otherwise it is buffered to be sent later.
|
|
|
+#### rtcIsClosed
|
|
|
|
|
|
-Data Channel and WebSocket: If the message may not be sent immediately due to flow control or congestion control, it is buffered until it can actually be sent. You can retrieve the current buffered data size with `rtcGetBufferedAmount`.
|
|
|
-Tracks are an exception: There is no flow or congestion control, messages are never buffered and `rtcGetBufferedAmount` always returns 0.
|
|
|
+```
|
|
|
+bool rtcIsClosed(int id)
|
|
|
+```
|
|
|
+
|
|
|
+Arguments:
|
|
|
+
|
|
|
+- `id`: the channel identifier
|
|
|
+
|
|
|
+Return value: `true` if the channel exists and is closed (not open and not connecting), `false` otherwise
|
|
|
|
|
|
#### rtcGetBufferedAmount
|
|
|
|