proxygen
folly::AsyncServerSocket::ServerEventHandler Struct Reference
Inheritance diagram for folly::AsyncServerSocket::ServerEventHandler:
folly::EventHandler

Public Member Functions

 ServerEventHandler (EventBase *eventBase, int socket, AsyncServerSocket *parent, sa_family_t addressFamily)
 
 ServerEventHandler (const ServerEventHandler &other)
 
ServerEventHandleroperator= (const ServerEventHandler &other)
 
void handlerReady (uint16_t events) noexceptoverride
 
- Public Member Functions inherited from folly::EventHandler
 EventHandler (EventBase *eventBase, int fd)
 
 EventHandler (EventBase *eventBase=nullptr, NetworkSocket fd=NetworkSocket())
 
virtual ~EventHandler ()
 
bool registerHandler (uint16_t events)
 
void unregisterHandler ()
 
bool isHandlerRegistered () const
 
void attachEventBase (EventBase *eventBase)
 
void detachEventBase ()
 
void changeHandlerFD (int fd)
 
void changeHandlerFD (NetworkSocket fd)
 
void initHandler (EventBase *eventBase, int fd)
 
void initHandler (EventBase *eventBase, NetworkSocket fd)
 
uint16_t getRegisteredEvents () const
 
bool registerInternalHandler (uint16_t events)
 
bool isPending () const
 

Public Attributes

EventBaseeventBase_
 
int socket_
 
AsyncServerSocketparent_
 
sa_family_t addressFamily_
 

Additional Inherited Members

- Public Types inherited from folly::EventHandler
enum  EventFlags {
  NONE = 0, READ = EV_READ, WRITE = EV_WRITE, READ_WRITE = (READ | WRITE),
  PERSIST = EV_PERSIST
}
 

Detailed Description

Definition at line 825 of file AsyncServerSocket.h.

Constructor & Destructor Documentation

folly::AsyncServerSocket::ServerEventHandler::ServerEventHandler ( EventBase eventBase,
int  socket,
AsyncServerSocket parent,
sa_family_t  addressFamily 
)
inline

Definition at line 826 of file AsyncServerSocket.h.

831  : EventHandler(eventBase, socket),
832  eventBase_(eventBase),
833  socket_(socket),
834  parent_(parent),
835  addressFamily_(addressFamily) {}
NetworkSocket socket(int af, int type, int protocol)
Definition: NetOps.cpp:412
EventHandler(EventBase *eventBase, int fd)
Definition: EventHandler.h:65
folly::Function< void()> parent
Definition: AtFork.cpp:34
folly::AsyncServerSocket::ServerEventHandler::ServerEventHandler ( const ServerEventHandler other)
inline

Definition at line 837 of file AsyncServerSocket.h.

838  : EventHandler(other.eventBase_, other.socket_),
839  eventBase_(other.eventBase_),
840  socket_(other.socket_),
841  parent_(other.parent_),
842  addressFamily_(other.addressFamily_) {}
EventHandler(EventBase *eventBase, int fd)
Definition: EventHandler.h:65

Member Function Documentation

void folly::AsyncServerSocket::ServerEventHandler::handlerReady ( uint16_t  events)
inlineoverridevirtualnoexcept

handlerReady() is invoked when the handler is ready.

Parameters
eventsA bitset indicating the events that are ready.

Implements folly::EventHandler.

Definition at line 859 of file AsyncServerSocket.h.

References socket_.

859  {
861  }
virtual void handlerReady(uint16_t events, int socket, sa_family_t family) noexcept
ServerEventHandler& folly::AsyncServerSocket::ServerEventHandler::operator= ( const ServerEventHandler other)
inline

Definition at line 844 of file AsyncServerSocket.h.

References addressFamily_, folly::AsyncServerSocket::attachEventBase(), folly::AsyncServerSocket::detachEventBase(), eventBase_, folly::AsyncServerSocket::eventBase_, parent_, socket_, and socket_.

844  {
845  if (this != &other) {
846  eventBase_ = other.eventBase_;
847  socket_ = other.socket_;
848  parent_ = other.parent_;
849  addressFamily_ = other.addressFamily_;
850 
851  detachEventBase();
852  attachEventBase(other.eventBase_);
853  changeHandlerFD(other.socket_);
854  }
855  return *this;
856  }
void attachEventBase(EventBase *eventBase)
void changeHandlerFD(int fd)
Definition: EventHandler.h:143

Member Data Documentation

sa_family_t folly::AsyncServerSocket::ServerEventHandler::addressFamily_

Definition at line 866 of file AsyncServerSocket.h.

Referenced by operator=().

EventBase* folly::AsyncServerSocket::ServerEventHandler::eventBase_

Definition at line 863 of file AsyncServerSocket.h.

Referenced by operator=().

AsyncServerSocket* folly::AsyncServerSocket::ServerEventHandler::parent_

Definition at line 865 of file AsyncServerSocket.h.

Referenced by operator=().

int folly::AsyncServerSocket::ServerEventHandler::socket_

Definition at line 864 of file AsyncServerSocket.h.

Referenced by operator=().


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