[WebSocket] Add optional heartbeat via "ping" control frames.

Has no effect in Web exports since the browsers do not expose a way to
send ping control frames.
This commit is contained in:
Fabio Alessandrelli
2024-05-08 13:10:30 +02:00
parent 87318a2fb7
commit e2d62f8618
5 changed files with 53 additions and 1 deletions

View File

@@ -155,6 +155,10 @@
The extra HTTP headers to be sent during the WebSocket handshake.
[b]Note:[/b] Not supported in Web exports due to browsers' restrictions.
</member>
<member name="heartbeat_interval" type="float" setter="set_heartbeat_interval" getter="get_heartbeat_interval" default="0.0">
The interval (in seconds) at which the peer will automatically send WebSocket "ping" control frames. When set to [code]0[/code], no "ping" control frames will be sent.
[b]Note:[/b] Has no effect in Web exports due to browser restrictions.
</member>
<member name="inbound_buffer_size" type="int" setter="set_inbound_buffer_size" getter="get_inbound_buffer_size" default="65535">
The size of the input buffer in bytes (roughly the maximum amount of memory that will be allocated for the inbound packets).
</member>