Don't use private access in FlipperRSocketResponder

Summary:
Changing FlipperRSocketResponder to only use public parts of FlipperConnectionManagerImpl.

This means we can test it by injecting a FCM mock, and it can use its public interface.

Reviewed By: passy

Differential Revision: D14000078

fbshipit-source-id: c0431a888b0ca041807631c81b99fb8b947274d6
This commit is contained in:
John Knox
2019-02-11 14:01:32 -08:00
committed by Facebook Github Bot
parent c48c1a728a
commit 5da8f35ee3
8 changed files with 142 additions and 47 deletions

View File

@@ -193,7 +193,7 @@ void FlipperConnectionManagerImpl::connectSecurely() {
std::move(address),
std::move(sslContext)),
std::move(parameters),
std::make_shared<FlipperRSocketResponder>(this),
std::make_shared<FlipperRSocketResponder>(this, connectionEventBase_),
std::chrono::seconds(connectionKeepaliveSeconds), // keepaliveInterval
nullptr, // stats
std::make_shared<ConnectionEvents>(this))
@@ -241,6 +241,12 @@ void FlipperConnectionManagerImpl::sendMessage(const folly::dynamic& message) {
});
}
void FlipperConnectionManagerImpl::onMessageReceived(
const folly::dynamic& message,
std::unique_ptr<FlipperResponder> responder) {
callbacks_->onMessageReceived(message, std::move(responder));
}
bool FlipperConnectionManagerImpl::isCertificateExchangeNeeded() {
if (failedConnectionAttempts_ >= 2) {
return true;