proxygen
folly::AsyncServerSocket::ConnectionEventCallback Class Referenceabstract

#include <AsyncServerSocket.h>

Inheritance diagram for folly::AsyncServerSocket::ConnectionEventCallback:
folly::test::TestConnectionEventCallback

Public Member Functions

virtual ~ConnectionEventCallback ()=default
 
virtual void onConnectionAccepted (const int socket, const SocketAddress &addr) noexcept=0
 
virtual void onConnectionAcceptError (const int err) noexcept=0
 
virtual void onConnectionDropped (const int socket, const SocketAddress &addr) noexcept=0
 
virtual void onConnectionEnqueuedForAcceptorCallback (const int socket, const SocketAddress &addr) noexcept=0
 
virtual void onConnectionDequeuedByAcceptorCallback (const int socket, const SocketAddress &addr) noexcept=0
 
virtual void onBackoffStarted () noexcept=0
 
virtual void onBackoffEnded () noexcept=0
 
virtual void onBackoffError () noexcept=0
 

Detailed Description

A callback interface to get notified of client socket events.

The ConnectionEventCallback implementations need to be thread-safe as the callbacks may be called from different threads.

Definition at line 77 of file AsyncServerSocket.h.

Constructor & Destructor Documentation

virtual folly::AsyncServerSocket::ConnectionEventCallback::~ConnectionEventCallback ( )
virtualdefault

Member Function Documentation

virtual void folly::AsyncServerSocket::ConnectionEventCallback::onBackoffEnded ( )
pure virtualnoexcept

onBackoffEnded is called when the backoff period has ended and the socket has successfully resumed accepting new connections if there is any AcceptCallback registered.

Implemented in folly::test::TestConnectionEventCallback.

Referenced by folly::AsyncServerSocket::backoffTimeoutExpired().

virtual void folly::AsyncServerSocket::ConnectionEventCallback::onBackoffError ( )
pure virtualnoexcept

onBackoffError is called when there is an error entering backoff

Implemented in folly::test::TestConnectionEventCallback.

Referenced by folly::AsyncServerSocket::enterBackoff().

virtual void folly::AsyncServerSocket::ConnectionEventCallback::onBackoffStarted ( )
pure virtualnoexcept

onBackoffStarted is called when the socket has successfully started backing off accepting new client sockets.

Implemented in folly::test::TestConnectionEventCallback.

Referenced by folly::AsyncServerSocket::enterBackoff().

virtual void folly::AsyncServerSocket::ConnectionEventCallback::onConnectionAccepted ( const int  socket,
const SocketAddress addr 
)
pure virtualnoexcept

onConnectionAccepted() is called right after a client connection is accepted using the system accept()/accept4() APIs.

Implemented in folly::test::TestConnectionEventCallback.

Referenced by folly::AsyncServerSocket::handlerReady().

virtual void folly::AsyncServerSocket::ConnectionEventCallback::onConnectionAcceptError ( const int  err)
pure virtualnoexcept

onConnectionAcceptError() is called when an error occurred accepting a connection.

Implemented in folly::test::TestConnectionEventCallback.

Referenced by folly::AsyncServerSocket::handlerReady().

virtual void folly::AsyncServerSocket::ConnectionEventCallback::onConnectionDequeuedByAcceptorCallback ( const int  socket,
const SocketAddress addr 
)
pure virtualnoexcept
virtual void folly::AsyncServerSocket::ConnectionEventCallback::onConnectionDropped ( const int  socket,
const SocketAddress addr 
)
pure virtualnoexcept

onConnectionDropped() is called when a connection is dropped, probably because of some error encountered.

Implemented in folly::test::TestConnectionEventCallback.

Referenced by folly::AsyncServerSocket::dispatchSocket(), and folly::AsyncServerSocket::handlerReady().

virtual void folly::AsyncServerSocket::ConnectionEventCallback::onConnectionEnqueuedForAcceptorCallback ( const int  socket,
const SocketAddress addr 
)
pure virtualnoexcept

onConnectionEnqueuedForAcceptorCallback() is called when the connection is successfully enqueued for an AcceptCallback to pick up.

Implemented in folly::test::TestConnectionEventCallback.

Referenced by folly::AsyncServerSocket::dispatchSocket().


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