You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-29 16:16:38 +00:00
Implement WebSocket clean close detection.
This commit is contained in:
@@ -57,7 +57,7 @@ EMSCRIPTEN_KEEPALIVE void _esws_on_close(void *obj, int code, char *reason, int
|
||||
EMWSClient *client = static_cast<EMWSClient *>(obj);
|
||||
client->_on_close_request(code, String(reason));
|
||||
client->_is_connecting = false;
|
||||
client->_on_disconnect();
|
||||
client->_on_disconnect(was_clean != 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ Error EMWSClient::connect_to_host(String p_host, String p_path, uint16_t p_port,
|
||||
if (!Module.IDHandler.has($0))
|
||||
return; // Godot Object is gone!
|
||||
var was_clean = 0;
|
||||
if (event.was_clean)
|
||||
if (event.wasClean)
|
||||
was_clean = 1;
|
||||
ccall("_esws_on_close",
|
||||
"void",
|
||||
|
||||
Reference in New Issue
Block a user