proxygen
wangle::TestableAcceptor Class Reference
Inheritance diagram for wangle::TestableAcceptor:
wangle::Acceptor folly::AsyncServerSocket::AcceptCallback wangle::ConnectionManager::Callback folly::AsyncUDPServerSocket::Callback

Public Member Functions

 TestableAcceptor (const ServerSocketConfig &accConfig)
 
 ~TestableAcceptor () override
 
void setActiveConnectionCountForLoadShedding (const uint64_t activeConnectionCountForLoadShedding)
 
void setConnectionCountForLoadShedding (const uint64_t connectionCountForLoadShedding)
 
- Public Member Functions inherited from wangle::Acceptor
 Acceptor (const ServerSocketConfig &accConfig)
 
 ~Acceptor () override
 
virtual void setSSLCacheProvider (const std::shared_ptr< SSLCacheProvider > &cacheProvider)
 
virtual void init (folly::AsyncServerSocket *serverSocket, folly::EventBase *eventBase, SSLStats *stats=nullptr)
 
virtual void resetSSLContextConfigs ()
 
void addSSLContextConfig (const SSLContextConfig &sslCtxConfig)
 
SSLContextManagergetSSLContextManager () const
 
virtual void setTLSTicketSecrets (const std::vector< std::string > &oldSecrets, const std::vector< std::string > &currentSecrets, const std::vector< std::string > &newSecrets)
 
uint32_t getNumConnections () const
 
virtual folly::EventBasegetEventBase () const
 
virtual wangle::ConnectionManagergetConnectionManager ()
 
void addConnection (wangle::ManagedConnection *connection)
 
State getState () const
 
std::chrono::milliseconds getConnTimeout () const
 
const std::stringgetName () const
 
std::chrono::milliseconds getSSLHandshakeTimeout () const
 
void setGracefulShutdownTimeout (std::chrono::milliseconds gracefulShutdown)
 
std::chrono::milliseconds getGracefulShutdownTimeout () const
 
virtual void forceStop ()
 
bool isSSL () const
 
const ServerSocketConfiggetConfig () const
 
virtual void onDoneAcceptingConnection (int fd, const folly::SocketAddress &clientAddr, std::chrono::steady_clock::time_point acceptTime) noexcept
 
void processEstablishedConnection (int fd, const folly::SocketAddress &clientAddr, std::chrono::steady_clock::time_point acceptTime, TransportInfo &tinfo) noexcept
 
virtual void startHandshakeManager (folly::AsyncSSLSocket::UniquePtr sslSock, Acceptor *acceptor, const folly::SocketAddress &clientAddr, std::chrono::steady_clock::time_point acceptTime, TransportInfo &tinfo) noexcept
 
void drainAllConnections ()
 
virtual void drainConnections (double pctToDrain)
 
void dropAllConnections ()
 
virtual void dropConnections (double pctToDrop)
 
virtual void plaintextConnectionReady (folly::AsyncTransportWrapper::UniquePtr sock, const folly::SocketAddress &clientAddr, const std::string &nextProtocolName, SecureTransportType secureTransportType, TransportInfo &tinfo)
 
void connectionReady (folly::AsyncTransportWrapper::UniquePtr sock, const folly::SocketAddress &clientAddr, const std::string &nextProtocolName, SecureTransportType secureTransportType, TransportInfo &tinfo)
 
virtual void sslConnectionReady (folly::AsyncTransportWrapper::UniquePtr sock, const folly::SocketAddress &clientAddr, const std::string &nextProtocol, SecureTransportType secureTransportType, TransportInfo &tinfo)
 
virtual void sslConnectionError (const folly::exception_wrapper &ex)
 
virtual void updateSSLStats (const folly::AsyncTransportWrapper *, std::chrono::milliseconds, SSLErrorEnum) noexcept
 
- Public Member Functions inherited from folly::AsyncServerSocket::AcceptCallback
virtual ~AcceptCallback ()=default
 
virtual void acceptStarted () noexcept
 
- Public Member Functions inherited from wangle::ConnectionManager::Callback
virtual ~Callback ()=default
 
- Public Member Functions inherited from folly::AsyncUDPServerSocket::Callback
virtual void onListenPaused () noexcept
 
virtual void onListenResumed () noexcept
 
virtual ~Callback ()=default
 

Protected Member Functions

uint64_t getConnectionCountForLoadShedding () const override
 
uint64_t getActiveConnectionCountForLoadShedding () const override
 
- Protected Member Functions inherited from wangle::Acceptor
virtual uint64_t getWorkerMaxConnections () const
 
virtual bool canAccept (const folly::SocketAddress &)
 
virtual void onNewConnection (folly::AsyncTransportWrapper::UniquePtr, const folly::SocketAddress *, const std::string &, SecureTransportType, const TransportInfo &)
 
void onListenStarted () noexceptoverride
 
void onListenStopped () noexceptoverride
 
void onDataAvailable (std::shared_ptr< folly::AsyncUDPSocket >, const folly::SocketAddress &, std::unique_ptr< folly::IOBuf >, bool) noexceptoverride
 
virtual folly::AsyncSocket::UniquePtr makeNewAsyncSocket (folly::EventBase *base, int fd)
 
virtual folly::AsyncSSLSocket::UniquePtr makeNewAsyncSSLSocket (const std::shared_ptr< folly::SSLContext > &ctx, folly::EventBase *base, int fd)
 
virtual void onConnectionsDrained ()
 
void connectionAccepted (int fd, const folly::SocketAddress &clientAddr) noexceptoverride
 
void acceptError (const std::exception &ex) noexceptoverride
 
void acceptStopped () noexceptoverride
 
void onEmpty (const wangle::ConnectionManager &cm) override
 
void onConnectionAdded (const ManagedConnection *) override
 
void onConnectionRemoved (const ManagedConnection *) override
 
void setLoadShedConfig (std::shared_ptr< const LoadShedConfiguration > loadShedConfig, const IConnectionCounter *counter)
 
virtual void initDownstreamConnectionManager (folly::EventBase *eventBase)
 
virtual DefaultToFizzPeekingCallbackgetFizzPeeker ()
 
virtual std::shared_ptr< fizz::server::FizzServerContextcreateFizzContext ()
 
virtual std::shared_ptr< fizz::server::TicketCiphercreateFizzTicketCipher (folly::Optional< std::string >=folly::none)
 
void updateFizzContext (fizz::server::FizzServerContext *)
 

Private Attributes

uint64_t connectionCountForLoadShedding_ {0}
 
uint64_t activeConnectionCountForLoadShedding_ {0}
 

Additional Inherited Members

- Public Types inherited from wangle::Acceptor
enum  State : uint32_t { State::kInit, State::kRunning, State::kDraining, State::kDone }
 
- Static Public Member Functions inherited from wangle::Acceptor
static uint64_t getTotalNumPendingSSLConns ()
 
- Protected Attributes inherited from wangle::Acceptor
folly::EventBasebase_ {nullptr}
 
const ServerSocketConfig accConfig_
 
folly::AsyncSocket::OptionMap socketOptions_
 
std::unique_ptr< SSLContextManagersslCtxManager_
 
SecurityProtocolContextManager securityProtocolCtxManager_
 
TLSPlaintextPeekingCallback tlsPlaintextPeekingCallback_
 
DefaultToSSLPeekingCallback defaultPeekingCallback_
 
DefaultToFizzPeekingCallback defaultFizzPeeker_
 
wangle::ConnectionManager::UniquePtr downstreamConnectionManager_
 
std::shared_ptr< SSLCacheProvidercacheProvider_
 
wangle::TLSTicketKeySeeds currentSecrets_
 

Detailed Description

Definition at line 32 of file AcceptorTest.cpp.

Constructor & Destructor Documentation

wangle::TestableAcceptor::TestableAcceptor ( const ServerSocketConfig accConfig)
inlineexplicit

Definition at line 34 of file AcceptorTest.cpp.

34  :
35  Acceptor(accConfig) {}
Acceptor(const ServerSocketConfig &accConfig)
Definition: Acceptor.cpp:54
wangle::TestableAcceptor::~TestableAcceptor ( )
inlineoverride

Definition at line 36 of file AcceptorTest.cpp.

36 {}

Member Function Documentation

uint64_t wangle::TestableAcceptor::getActiveConnectionCountForLoadShedding ( ) const
inlineoverrideprotectedvirtual

Reimplemented from wangle::Acceptor.

Definition at line 56 of file AcceptorTest.cpp.

56  {
58  }
uint64_t activeConnectionCountForLoadShedding_
uint64_t wangle::TestableAcceptor::getConnectionCountForLoadShedding ( void  ) const
inlineoverrideprotectedvirtual

Reimplemented from wangle::Acceptor.

Definition at line 53 of file AcceptorTest.cpp.

53  {
55  }
uint64_t connectionCountForLoadShedding_
void wangle::TestableAcceptor::setActiveConnectionCountForLoadShedding ( const uint64_t  activeConnectionCountForLoadShedding)
inline

Definition at line 38 of file AcceptorTest.cpp.

39  {
41  activeConnectionCountForLoadShedding;
42  }
uint64_t activeConnectionCountForLoadShedding_
void wangle::TestableAcceptor::setConnectionCountForLoadShedding ( const uint64_t  connectionCountForLoadShedding)
inline

Definition at line 44 of file AcceptorTest.cpp.

45  {
46  connectionCountForLoadShedding_ = connectionCountForLoadShedding;
47  }
uint64_t connectionCountForLoadShedding_

Member Data Documentation

uint64_t wangle::TestableAcceptor::activeConnectionCountForLoadShedding_ {0}
private

Definition at line 62 of file AcceptorTest.cpp.

uint64_t wangle::TestableAcceptor::connectionCountForLoadShedding_ {0}
private

Definition at line 61 of file AcceptorTest.cpp.


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