proxygen
|
#include <ServerBootstrap-inl.h>
Classes | |
class | ServerConnection |
Public Member Functions | |
ServerAcceptor (std::shared_ptr< AcceptPipelineFactory > acceptPipelineFactory, std::shared_ptr< PipelineFactory< Pipeline >> childPipelineFactory, const ServerSocketConfig &accConfig) | |
void | init (folly::AsyncServerSocket *serverSocket, folly::EventBase *eventBase, SSLStats *stats=nullptr) override |
void | read (Context *, AcceptPipelineType conn) override |
void | readEOF (Context *) override |
void | readException (Context *, folly::exception_wrapper) override |
void | onNewConnection (folly::AsyncTransportWrapper::UniquePtr transport, const folly::SocketAddress *clientAddr, const std::string &nextProtocolName, SecureTransportType secureTransportType, const TransportInfo &tinfo) override |
void | acceptStopped () noexceptoverride |
void | drainConnections (double pct) noexceptoverride |
void | dropConnections (double pct) noexceptoverride |
void | forceStop () noexceptoverride |
void | onDataAvailable (std::shared_ptr< folly::AsyncUDPSocket > socket, const folly::SocketAddress &addr, std::unique_ptr< folly::IOBuf > buf, bool) noexceptoverride |
void | onConnectionAdded (const ManagedConnection *) override |
void | onConnectionRemoved (const ManagedConnection *) override |
void | sslConnectionError (const folly::exception_wrapper &ex) override |
Public Member Functions inherited from wangle::Acceptor | |
Acceptor (const ServerSocketConfig &accConfig) | |
~Acceptor () override | |
virtual void | setSSLCacheProvider (const std::shared_ptr< SSLCacheProvider > &cacheProvider) |
virtual void | resetSSLContextConfigs () |
void | addSSLContextConfig (const SSLContextConfig &sslCtxConfig) |
SSLContextManager * | getSSLContextManager () const |
virtual void | setTLSTicketSecrets (const std::vector< std::string > &oldSecrets, const std::vector< std::string > ¤tSecrets, const std::vector< std::string > &newSecrets) |
uint32_t | getNumConnections () const |
virtual folly::EventBase * | getEventBase () const |
virtual wangle::ConnectionManager * | getConnectionManager () |
void | addConnection (wangle::ManagedConnection *connection) |
State | getState () const |
std::chrono::milliseconds | getConnTimeout () const |
const std::string & | getName () const |
std::chrono::milliseconds | getSSLHandshakeTimeout () const |
void | setGracefulShutdownTimeout (std::chrono::milliseconds gracefulShutdown) |
std::chrono::milliseconds | getGracefulShutdownTimeout () const |
bool | isSSL () const |
const ServerSocketConfig & | getConfig () 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 () |
void | dropAllConnections () |
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 | 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 |
Public Member Functions inherited from wangle::InboundHandler< AcceptPipelineType > | |
~InboundHandler () override=default | |
virtual void | transportActive (Context *ctx) |
virtual void | transportInactive (Context *ctx) |
Public Member Functions inherited from wangle::HandlerBase< InboundHandlerContext< AcceptPipelineType > > | |
virtual | ~HandlerBase ()=default |
virtual void | attachPipeline (InboundHandlerContext< AcceptPipelineType > *) |
virtual void | detachPipeline (InboundHandlerContext< AcceptPipelineType > *) |
InboundHandlerContext< AcceptPipelineType > * | getContext () |
Private Attributes | |
std::shared_ptr< AcceptPipelineFactory > | acceptPipelineFactory_ |
std::shared_ptr< AcceptPipeline > | acceptPipeline_ |
std::shared_ptr< PipelineFactory< Pipeline > > | childPipelineFactory_ |
Definition at line 65 of file ServerBootstrap-inl.h.
|
inlineexplicit |
Definition at line 116 of file ServerBootstrap-inl.h.
|
inlineoverridevirtualnoexcept |
acceptStopped() will be called when this AcceptCallback is removed from the AsyncServerSocket, or when the AsyncServerSocket is destroyed, whichever occurs first.
No more calls to connectionAccepted() or acceptError() will be made after acceptStopped() is invoked.
Reimplemented from wangle::Acceptor.
Definition at line 185 of file ServerBootstrap-inl.h.
References wangle::AcceptorException::ACCEPT_STOPPED, and wangle::Acceptor::acceptStopped().
|
inlineoverridevirtualnoexcept |
Drain defined percentage of connections.
Reimplemented from wangle::Acceptor.
Definition at line 194 of file ServerBootstrap-inl.h.
References wangle::AcceptorException::DRAIN_CONN_PCT, and wangle::Acceptor::drainConnections().
|
inlineoverridevirtualnoexcept |
Force-drop "pct" (0.0 to 1.0) of remaining client connections, regardless of whether they are busy or idle.
Note: unlike dropAllConnections(), this function can be called from any thread.
Reimplemented from wangle::Acceptor.
Definition at line 203 of file ServerBootstrap-inl.h.
References wangle::AcceptorException::DROP_CONN_PCT, and wangle::Acceptor::dropConnections().
|
inlineoverridevirtualnoexcept |
Force the acceptor to drop all connections and stop processing.
This function may be called from any thread. The acceptor will not necessarily stop before this function returns: the stop will be scheduled to run in the acceptor's thread.
Reimplemented from wangle::Acceptor.
Definition at line 212 of file ServerBootstrap-inl.h.
References wangle::AcceptorException::FORCE_STOP, and wangle::Acceptor::forceStop().
|
inlineoverridevirtual |
Initialize the Acceptor to run in the specified EventBase thread, receiving connections from the specified AsyncServerSocket.
This method will be called from the AsyncServerSocket's primary thread, not the specified EventBase thread.
Reimplemented from wangle::Acceptor.
Definition at line 125 of file ServerBootstrap-inl.h.
References wangle::Acceptor::init().
|
inlineoverridevirtual |
Invoked when a connection is added to the ConnectionManager.
Reimplemented from wangle::Acceptor.
Definition at line 230 of file ServerBootstrap-inl.h.
References wangle::CONN_ADDED.
|
inlineoverridevirtual |
Invoked when a connection is removed from the ConnectionManager.
Reimplemented from wangle::Acceptor.
Definition at line 234 of file ServerBootstrap-inl.h.
References wangle::CONN_REMOVED.
|
inlineoverridevirtualnoexcept |
Invoked when a new packet is received
Reimplemented from wangle::Acceptor.
Definition at line 222 of file ServerBootstrap-inl.h.
References addr, std::tr1::make_tuple(), and folly::netops::socket().
|
inlineoverridevirtual |
Invoked when a new connection is created. This is where application starts processing a new downstream connection.
NOTE: Application should add the new connection to downstreamConnectionManager so that it can be garbage collected after certain period of idleness.
sock | the socket connected to the client |
address | the address of the client |
nextProtocolName | the name of the L6 or L7 protocol to be spoken on the connection, if known (e.g., from TLS NPN during secure connection setup), or an empty string if unknown |
secureTransportType | the name of the secure transport type that was requested by the client. |
Reimplemented from wangle::Acceptor.
Definition at line 174 of file ServerBootstrap-inl.h.
|
inlineoverridevirtual |
Implements wangle::InboundHandler< AcceptPipelineType >.
Definition at line 141 of file ServerBootstrap-inl.h.
References wangle::Acceptor::addConnection(), and folly::gen::move.
|
inlineoverridevirtual |
Reimplemented from wangle::InboundHandler< AcceptPipelineType >.
Definition at line 170 of file ServerBootstrap-inl.h.
|
inlineoverridevirtual |
Reimplemented from wangle::InboundHandler< AcceptPipelineType >.
Definition at line 171 of file ServerBootstrap-inl.h.
|
inlineoverridevirtual |
Notification callback for SSL handshake failures.
Reimplemented from wangle::Acceptor.
Definition at line 238 of file ServerBootstrap-inl.h.
References wangle::Acceptor::sslConnectionError().
|
private |
Definition at line 245 of file ServerBootstrap-inl.h.
|
private |
Definition at line 244 of file ServerBootstrap-inl.h.
|
private |
Definition at line 246 of file ServerBootstrap-inl.h.