proxygen
|
#include <TestSSLServer.h>
Public Member Functions | |
SSLServerAcceptCallbackBase (HandshakeCallback *hcb) | |
~SSLServerAcceptCallbackBase () override | |
void | acceptError (const std::exception &ex) noexceptoverride |
void | connectionAccepted (int fd, const SocketAddress &) noexceptoverride |
virtual void | connAccepted (const std::shared_ptr< AsyncSSLSocket > &s)=0 |
void | detach () |
![]() | |
virtual | ~AcceptCallback ()=default |
virtual void | acceptStarted () noexcept |
virtual void | acceptStopped () noexcept |
Public Attributes | |
StateEnum | state |
HandshakeCallback * | hcb_ |
std::shared_ptr< SSLContext > | ctx_ |
std::shared_ptr< AsyncSSLSocket > | socket_ |
EventBase * | base_ |
Definition at line 49 of file TestSSLServer.h.
|
inlineexplicit |
Definition at line 51 of file TestSSLServer.h.
|
inlineoverride |
Definition at line 54 of file TestSSLServer.h.
References EXPECT_EQ, and folly::STATE_SUCCEEDED.
|
inlineoverridevirtualnoexcept |
acceptError() is called if an error occurs while accepting.
The AcceptCallback will remain installed even after an accept error, as the errors are typically somewhat transient, such as being out of file descriptors. The server socket must be explicitly stopped if you wish to stop accepting after an error.
ex | An exception representing the error. |
Implements folly::AsyncServerSocket::AcceptCallback.
Definition at line 58 of file TestSSLServer.h.
References folly::STATE_FAILED, and folly::WARNING.
Referenced by connectionAccepted().
|
pure virtual |
|
inlineoverridevirtualnoexcept |
connectionAccepted() is called whenever a new client connection is received.
The AcceptCallback will remain installed after connectionAccepted() returns.
fd | The newly accepted client socket. The AcceptCallback assumes ownership of this socket, and is responsible for closing it when done. The newly accepted file descriptor will have already been put into non-blocking mode. |
clientAddr | A reference to a SocketAddress struct containing the client's address. This struct is only guaranteed to remain valid until connectionAccepted() returns. |
Implements folly::AsyncServerSocket::AcceptCallback.
Definition at line 63 of file TestSSLServer.h.
References acceptError(), base_, folly::netops::close(), connAccepted(), ctx_, folly::INFO, folly::AsyncSSLSocket::newSocket(), s, and socket_.
|
inline |
Definition at line 88 of file TestSSLServer.h.
References socket_.
Referenced by folly::TestSSLServer::init().
EventBase* folly::SSLServerAcceptCallbackBase::base_ |
Definition at line 98 of file TestSSLServer.h.
Referenced by connectionAccepted(), and folly::TestSSLServer::init().
std::shared_ptr<SSLContext> folly::SSLServerAcceptCallbackBase::ctx_ |
Definition at line 96 of file TestSSLServer.h.
Referenced by connectionAccepted(), and folly::TestSSLServer::init().
HandshakeCallback* folly::SSLServerAcceptCallbackBase::hcb_ |
Definition at line 95 of file TestSSLServer.h.
std::shared_ptr<AsyncSSLSocket> folly::SSLServerAcceptCallbackBase::socket_ |
Definition at line 97 of file TestSSLServer.h.
Referenced by connectionAccepted(), and detach().
StateEnum folly::SSLServerAcceptCallbackBase::state |
Definition at line 94 of file TestSSLServer.h.