Click or drag to resize

WebSocketPeerClose Method

Closes this WebSocket connection. code is the status code for the closure (see RFC 6455 section 7.4 for a list of valid status codes). reason is the human readable reason for closing the connection (can be any UTF-8 string that's smaller than 123 bytes).

Note: To achieve a clean close, you will need to keep polling until either WebSocketClient.connection_closed or WebSocketServer.client_disconnected is received.

Note: The HTML5 export might not support all status codes. Please refer to browser-specific documentation for more details.

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public void Close(
	int code = 1000,
	string reason = ""
)

Parameters

code (Optional)
Type: SystemInt32

[Missing <param name="code"/> documentation for "M:Godot.WebSocketPeer.Close(System.Int32,System.String)"]

reason (Optional)
Type: SystemString

[Missing <param name="reason"/> documentation for "M:Godot.WebSocketPeer.Close(System.Int32,System.String)"]

See Also