Function WebSocketServer.listen
Starts listening on the given port.
You can specify the desired subprotocols via the "protocols" array. If the list empty (default), no sub-protocol will be requested.
If true
is passed as gd_mp_api
, the server will behave like a network peer for the MultiplayerAPI
, connections from non-Godot clients will not work, and dataReceived
will not be emitted.
If false
is passed instead (default), you must call PacketPeer
functions (put_packet
, get_packet
, etc.), on the WebSocketPeer
returned via get_peer(id)
to communicate with the peer with given id
(e.g. get_peer(id)
).
godot .core .defs .GodotError listen
(
const(long) port,
const(PoolArray!(godot.core.string.String)) protocols = PoolArray(godot_pool_string_array(0LU)),
const(bool) gd_mp_api = false
) nothrow @nogc;