Closes this WebSocket connection. [code]code[/code] is the status code for the closure (see RFC 6455 section 7.4 for a list of valid status codes). [code]reason[/code] is the human readable reason for closing the connection (can be any UTF-8 string that's smaller than 123 bytes).
[b]Note:[/b] To achieve a clean close, you will need to keep polling until either [signal WebSocketClient.connection_closed] or [signal WebSocketServer.client_disconnected] is received.
[b]Note:[/b] The HTML5 export might not support all status codes. Please refer to browser-specific documentation for more details.
Returns the current amount of data in the outbound websocket buffer. [b]Note:[/b] HTML5 exports use WebSocket.bufferedAmount, while other platforms use an internal buffer.
</description>
</method>
<methodname="get_write_mode"qualifiers="const">
<returntype="int"enum="WebSocketPeer.WriteMode"/>
<description>
Gets the current selected write mode. See [enum WriteMode].