Refactor endpoint verification prior to connection

Summary:
^

There's a similar issue/request for Android. So, this change moves the code out from the FlipperKit into Flipper as to be able to reuse it.

Reviewed By: aigoncharov

Differential Revision: D35961745

fbshipit-source-id: aa255db582a7852dc06c2feaba389d1dac3b0f67
This commit is contained in:
Lorenzo Blasa
2022-05-03 11:24:17 -07:00
committed by Facebook GitHub Bot
parent 2120a94dc3
commit 3826f2c8ef
3 changed files with 90 additions and 50 deletions

View File

@@ -0,0 +1,20 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <string>
namespace facebook {
namespace flipper {
struct ConnectionEndpointVerifier {
/** Verifies whether the given endpoint is listening
for incoming connections. */
static bool verify(const std::string& host, int port);
};
} // namespace flipper
} // namespace facebook