proxygen
folly::ConnectClient Class Reference
Inheritance diagram for folly::ConnectClient:
folly::AsyncSocket::ConnectCallback

Public Member Functions

 ConnectClient ()=default
 
Future< bool > getFuture ()
 
void connect (const folly::SocketAddress &addr)
 
void connectSuccess () noexceptoverride
 
void connectErr (const AsyncSocketException &) noexceptoverride
 
void setCtx (std::shared_ptr< SSLContext > ctx)
 
- Public Member Functions inherited from folly::AsyncSocket::ConnectCallback
virtual ~ConnectCallback ()=default
 

Private Attributes

EvbAndContext t1_
 
folly::Promise< bool > promise_
 
std::shared_ptr< AsyncSSLSocketsocket_
 

Detailed Description

Definition at line 194 of file AsyncSSLSocketTest2.cpp.

Constructor & Destructor Documentation

folly::ConnectClient::ConnectClient ( )
default

Member Function Documentation

void folly::ConnectClient::connect ( const folly::SocketAddress addr)
inline

Definition at line 202 of file AsyncSSLSocketTest2.cpp.

References socket_.

202  {
205  socket_->connect(this, addr);
206  });
207  }
std::shared_ptr< AsyncSSLSocket > createSocket()
std::shared_ptr< AsyncSSLSocket > socket_
bool runInEventBaseThread(void(*fn)(T *), T *arg)
Definition: EventBase.h:794
void folly::ConnectClient::connectErr ( const AsyncSocketException ex)
inlineoverridevirtualnoexcept

connectErr() will be invoked if the connection attempt fails.

Parameters
exAn exception describing the error that occurred.

Implements folly::AsyncSocket::ConnectCallback.

Definition at line 214 of file AsyncSSLSocketTest2.cpp.

References promise_, and socket_.

214  {
215  socket_.reset();
216  promise_.setValue(false);
217  }
std::shared_ptr< AsyncSSLSocket > socket_
folly::Promise< bool > promise_
std::enable_if< std::is_same< Unit, B >::value, void >::type setValue()
Definition: Promise.h:326
void folly::ConnectClient::connectSuccess ( )
inlineoverridevirtualnoexcept

connectSuccess() will be invoked when the connection has been successfully established.

Implements folly::AsyncSocket::ConnectCallback.

Definition at line 209 of file AsyncSSLSocketTest2.cpp.

References promise_, and socket_.

209  {
210  socket_.reset();
211  promise_.setValue(true);
212  }
std::shared_ptr< AsyncSSLSocket > socket_
folly::Promise< bool > promise_
std::enable_if< std::is_same< Unit, B >::value, void >::type setValue()
Definition: Promise.h:326
Future<bool> folly::ConnectClient::getFuture ( )
inline

Definition at line 198 of file AsyncSSLSocketTest2.cpp.

References promise_.

198  {
199  return promise_.getFuture();
200  }
folly::Promise< bool > promise_
Future< T > getFuture()
Definition: Promise-inl.h:97
void folly::ConnectClient::setCtx ( std::shared_ptr< SSLContext ctx)
inline

Definition at line 219 of file AsyncSSLSocketTest2.cpp.

219  {
220  t1_.ctx_ = ctx;
221  }
std::shared_ptr< SSLContext > ctx_

Member Data Documentation

folly::Promise<bool> folly::ConnectClient::promise_
private

Definition at line 226 of file AsyncSSLSocketTest2.cpp.

std::shared_ptr<AsyncSSLSocket> folly::ConnectClient::socket_
private

Definition at line 227 of file AsyncSSLSocketTest2.cpp.

EvbAndContext folly::ConnectClient::t1_
private

Definition at line 224 of file AsyncSSLSocketTest2.cpp.


The documentation for this class was generated from the following file: