godotengine / godotengine/godot-docs

Close method of WebSocketPeer not properly documented for clean close

Open
#3,415 0 comments 0 reactions 0 assignees View on GitHub
area:class reference enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

I could be misreading the C++, but it seems in `modules/websocket/websocket_server.cpp`, online 146, if you are using the multiplayer API, then you need to be listening to the signal `peer_disconnected` instead of `client_disconnected` like the documentation says.

Change the statement:
```
Note: To achieve a clean close, you will need to keep polling until either WebSocketClient.connection_closed or WebSocketServer.client_disconnected is received.
```
to something like:
```
Note: To achieve a clean close, you will need to keep polling until either WebSocketClient.connection_closed or WebSocketServer.client_disconnected is received. If you
are using the high level multiplayer API, listen to the `peer_disconnected` signal instead.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.