Remove connection timeout

Summary:
This change mainly removes the connection timeout period as it may introduce a race condition in which slow server connections get terminated potentially creating connection loops.

Also, suspend and wait for all operations to complete once a socket is disconnected.

Reviewed By: ivanmisuno

Differential Revision: D43048252

fbshipit-source-id: 64c28a3d3d2fd4e065084d5f55a17444385c07e0
This commit is contained in:
Lorenzo Blasa
2023-02-07 05:55:11 -08:00
committed by Facebook GitHub Bot
parent d97dfae1a0
commit e9c0a459dd
2 changed files with 21 additions and 23 deletions

View File

@@ -125,13 +125,7 @@ bool FlipperWebSocket::connect(FlipperConnectionManager* manager) {
[socket_ connect];
auto state = connected.wait_for(std::chrono::seconds(10));
if (state == std::future_status::ready) {
return connected.get();
}
disconnect();
return false;
return connected.get();
}
void FlipperWebSocket::disconnect() {