Merge pull request #75850 from rsubtil/bugfix-lsp_dap_connection_poll

Poll LSP/DAP clients for connection status updates
This commit is contained in:
Fabio Alessandrelli 2023-04-11 10:19:24 +02:00 committed by GitHub
commit 4ab0b38940
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -970,6 +970,7 @@ void DebugAdapterProtocol::poll() {
List<Ref<DAPeer>> to_delete;
for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
Ref<DAPeer> peer = E->get();
peer->connection->poll();
StreamPeerTCP::Status status = peer->connection->get_status();
if (status == StreamPeerTCP::STATUS_NONE || status == StreamPeerTCP::STATUS_ERROR) {
to_delete.push_back(peer);

View file

@ -237,6 +237,7 @@ void GDScriptLanguageProtocol::poll() {
HashMap<int, Ref<LSPeer>>::Iterator E = clients.begin();
while (E != clients.end()) {
Ref<LSPeer> peer = E->value;
peer->connection->poll();
StreamPeerTCP::Status status = peer->connection->get_status();
if (status == StreamPeerTCP::STATUS_NONE || status == StreamPeerTCP::STATUS_ERROR) {
on_client_disconnected(E->key);