34 template <
typename Pipeline>
42 std::shared_ptr<folly::AsyncSocket>
socket,
49 std::
move(sslSessionEstablishedCallback)) {}
73 folly::make_exception_wrapper<folly::AsyncSocketException>(ex));
79 std::shared_ptr<folly::AsyncSocket>
socket_;
89 std::shared_ptr<folly::IOThreadPoolExecutor>
group) {
101 std::chrono::milliseconds timeout =
102 std::chrono::milliseconds(0))
override {
107 base->runImmediatelyOrRunInEventBaseThreadAndWait([&](){
108 std::shared_ptr<folly::AsyncSocket>
socket;
112 if (!this->
sni_.empty()) {
113 sslSocket->setServerName(this->
sni_);
140 std::shared_ptr<folly::IOThreadPoolExecutor>
group_;
149 return std::make_unique<ClientBootstrap<DefaultPipeline>>();
std::unique_ptr< SSLSessionEstablishedCallback > SSLSessionEstablishedCallbackUniquePtr
SSLSessionEstablishedCallbackUniquePtr sslSessionEstablishedCallback_
SSL_SESSION * sslSession_
EventBase * getEventBase() const
std::shared_ptr< folly::IOThreadPoolExecutor > group_
BaseClientBootstrap * sslSessionEstablishedCallback(SSLSessionEstablishedCallbackUniquePtr sslSessionEstablishedCallback)
ClientBootstrap * bootstrap_
constexpr detail::Map< Move > move
ClientBootstrap * bind(int port)
folly::Future< Pipeline * > connect(const folly::SocketAddress &address, std::chrono::milliseconds timeout=std::chrono::milliseconds(0)) override
requires E e noexcept(noexcept(s.error(std::move(e))))
void connectErr(const folly::AsyncSocketException &ex) noexceptoverride
static EventBaseManager * get()
static std::shared_ptr< AsyncSSLSocket > newSocket(const std::shared_ptr< folly::SSLContext > &ctx, EventBase *evb, int fd, bool server=true, bool deferSecurityNegotiation=false)
bool deferSecurityNegotiation_
folly::SSLContextPtr sslContext_
std::enable_if<!std::is_same< T, folly::Unit >::value >::type transportActive()
BaseClientBootstrap::Ptr newClient() override
~ClientBootstrap() override=default
std::shared_ptr< folly::AsyncSocket > socket_
NetworkSocket socket(int af, int type, int protocol)
virtual bool getSSLSessionReused() const
void connectSuccess() noexceptoverride
static std::shared_ptr< AsyncSocket > newSocket(EventBase *evb)
folly::Promise< Pipeline * > promise_
SSL_SESSION * getSSLSession()
virtual void makePipeline(std::shared_ptr< folly::AsyncTransportWrapper > socket)
std::unique_ptr< BaseClientBootstrap > Ptr
folly::DestructorCheck::Safety safety_
ClientBootstrap * group(std::shared_ptr< folly::IOThreadPoolExecutor > group)
ConnectCallback(folly::Promise< Pipeline * > promise, ClientBootstrap *bootstrap, std::shared_ptr< folly::AsyncSocket > socket, SSLSessionEstablishedCallbackUniquePtr sslSessionEstablishedCallback)