Expose WebSocket set_buffers and document it.

This commit is contained in:
Fabio Alessandrelli
2019-06-15 17:13:26 +02:00
parent ee90da4acb
commit 5b2f098ed4
3 changed files with 20 additions and 0 deletions

View File

@@ -18,6 +18,24 @@
Returns the [WebSocketPeer] associated to the given [code]peer_id[/code].
</description>
</method>
<method name="set_buffers">
<return type="int" enum="Error">
</return>
<argument index="0" name="input_buffer_size_kb" type="int">
</argument>
<argument index="1" name="input_max_packets" type="int">
</argument>
<argument index="2" name="output_buffer_size_kb" type="int">
</argument>
<argument index="3" name="output_max_packets" type="int">
</argument>
<description>
Configure the buffers sizes for this WebSocket peer. Default values can be specified in project settings under [code]network/limits[/code]. For server, values are meant per connected peer.
The first two parameters define the size and queued packets limits of the input buffer, the last two of the output buffer.
Buffer sizes are expressed in KiB, so [code]4 = 2^12 = 4096 bytes[/code]. All parameters will be rounded up to the nearest power of two.
NOTE: HTML5 exports only use the input buffer since the output one is managed by browsers.
</description>
</method>
</methods>
<signals>
<signal name="peer_packet">