WebSocketMultiplayerPeer

Inherits: NetworkedMultiplayerPeer < PacketPeer < Reference < Object

Inherited By: WebSocketClient, WebSocketServer

Base class for WebSocket server and client.

Description

Base class for WebSocket server and client, allowing them to be used as network peer for the MultiplayerAPI.

Properties

boolrefuse_new_connectionsO: false
TransferModetransfer_modeO: 2

Methods

WebSocketPeerget_peer ( int peer_id ) const
Errorset_buffers ( int input_buffer_size_kb, int input_max_packets, int output_buffer_size_kb, int output_max_packets )

Signals

  • peer_packet ( int peer_source )

Emitted when a packet is received from a peer.

Note: This signal is only emitted when the client or server is configured to use Godot multiplayer API.

Method Descriptions

Returns the WebSocketPeer associated to the given peer_id.


  • Error set_buffers ( int input_buffer_size_kb, int input_max_packets, int output_buffer_size_kb, int output_max_packets )

Configures the buffer sizes for this WebSocket peer. Default values can be specified in the Project Settings under network/limits. 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 4 = 2^12 = 4096 bytes. 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.

Doc ID missing

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 1970-01-01 at 00:00:00. It’s the English Stable version because it’s what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.