22 using namespace folly;
27 HTTPConnector::HTTPConnector(
Callback* callback,
34 :
cb_(CHECK_NOTNULL(callback))
62 std::chrono::milliseconds timeoutMs,
72 sock->connect(
this, connectAddr, timeoutMs.count(),
73 socketOptions, bindAddr);
79 const shared_ptr<SSLContext>&
context,
81 std::chrono::milliseconds timeoutMs,
91 sslSock->setSSLSession(session,
true );
93 sslSock->setServerName(serverName);
94 sslSock->forceCacheAddrOnFailure(
true);
97 sslSock->connect(
this, connectAddr, timeoutMs.count(),
98 socketOptions, bindAddr);
105 return std::chrono::milliseconds(0);
117 socket_->getLocalAddress(&localAddress);
118 socket_->getPeerAddress(&peerAddress);
120 std::unique_ptr<HTTPCodec>
codec;
128 std::make_shared<std::string>(
socket_->getApplicationProtocol());
virtual void connectSuccess(HTTPUpstreamSession *session)=0
wangle::TransportInfo transportInfo_
std::chrono::steady_clock::time_point acceptTime
constexpr detail::Map< Move > move
std::unique_ptr< DefaultHTTPCodecFactory > httpCodecFactory_
—— Concurrent Priority Queue Implementation ——
requires E e noexcept(noexcept(s.error(std::move(e))))
folly::AsyncTransportWrapper::UniquePtr socket_
std::map< OptionKey, int > OptionMap
static SSLResumeEnum getResumeState(folly::AsyncSSLSocket *sslSocket)
void setHTTPVersionOverride(bool enabled)
WheelTimerInstance timeout_
virtual void connectError(const folly::AsyncSocketException &ex)=0
void setPlaintextProtocol(const std::string &plaintextProto)
std::chrono::milliseconds timeElapsed()
std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type make_unique(Args &&...args)
~HTTPConnector() override
std::shared_ptr< std::string > sslCipher
std::chrono::milliseconds millisecondsSince(std::chrono::time_point< ClockType > t)
void connect(folly::EventBase *eventBase, const folly::SocketAddress &connectAddr, std::chrono::milliseconds timeoutMs=std::chrono::milliseconds(0), const folly::AsyncSocket::OptionMap &socketOptions=folly::AsyncSocket::emptyOptionMap, const folly::SocketAddress &bindAddr=folly::AsyncSocket::anyAddress())
void connectSuccess() noexceptoverride
std::chrono::time_point< ClockType > getCurrentTime()
void connectSSL(folly::EventBase *eventBase, const folly::SocketAddress &connectAddr, const std::shared_ptr< folly::SSLContext > &ctx, SSL_SESSION *session=nullptr, std::chrono::milliseconds timeoutMs=std::chrono::milliseconds(0), const folly::AsyncSocket::OptionMap &socketOptions=folly::AsyncSocket::emptyOptionMap, const folly::SocketAddress &bindAddr=folly::AsyncSocket::anyAddress(), const std::string &serverName=empty_string)
std::shared_ptr< std::string > appProtocol
void connectErr(const folly::AsyncSocketException &ex) noexceptoverride
std::chrono::milliseconds sslSetupTime
int getSSLVersion() const
virtual const char * getNegotiatedCipherName() const
bool timePointInitialized(const T &time)
HTTPConnector(Callback *callback, folly::HHWheelTimer *timeoutSet)
std::string plaintextProtocol_