New 'isConnected' API

Summary:
Expose a new API to be used to check if there's an open connection with Flipper Desktop.

Changelog: new FlipperClient isConnected API

Reviewed By: antonk52

Differential Revision: D46841095

fbshipit-source-id: 82a60f52496fb218cb50c6a28d7ffe7225ae23aa
This commit is contained in:
Lorenzo Blasa
2023-06-20 00:46:55 -07:00
committed by Facebook GitHub Bot
parent daa3a38ed3
commit 7cec520729
7 changed files with 28 additions and 18 deletions

View File

@@ -160,6 +160,13 @@ void FlipperClient::onDisconnected() {
});
}
bool FlipperClient::isConnected() {
if (socket_ != nullptr) {
return socket_->isConnected();
}
return false;
}
void FlipperClient::onMessageReceived(
const dynamic& message,
std::unique_ptr<FlipperResponder> uniqueResponder) {