Drizzled Public API Documentation

drizzled::plugin::Listen Class Referenceabstract

#include <listen.h>

Inheritance diagram for drizzled::plugin::Listen:
drizzled::plugin::Plugin drizzled::plugin::ListenTcp drizzle_plugin::ListenMySQLProtocol drizzle_plugin::drizzle_protocol::ListenDrizzleProtocol drizzle_plugin::mysql_unix_socket_protocol::Protocol

Public Types

typedef std::pair< const
std::string, const std::string > 
map_key
 
typedef std::map< const
map_key, plugin::Plugin * > 
map
 
typedef std::vector< Plugin * > vector
 

Public Member Functions

 Listen (std::string name_arg)
 
std::vector< ListenCounter * > & getListenCounters ()
 
virtual bool getFileDescriptors (std::vector< int > &fds)=0
 
virtual plugin::ClientgetClient (int fd)=0
 
virtual void shutdownPlugin ()
 
virtual void prime ()
 
virtual void startup (drizzled::Session &)
 
void activate ()
 
void deactivate ()
 
bool isActive () const
 
const std::string & getName () const
 
void setModule (module::Module *module)
 
const std::string & getTypeName () const
 
virtual bool removeLast () const
 
const std::string & getModuleName () const
 

Static Public Member Functions

static ListenVector & getListenProtocols ()
 
static bool addPlugin (Listen *)
 
static void removePlugin (Listen *)
 
static bool setup (void)
 
static plugin::ClientgetClient ()
 
static plugin::ClientgetNullClient ()
 
static void shutdown ()
 

Protected Attributes

std::vector< ListenCounter * > counters
 

Detailed Description

This class is used by client plugins to provide and manage the listening interface for new client instances.

Definition at line 37 of file listen.h.

Member Function Documentation

bool drizzled::plugin::Listen::addPlugin ( plugin::Listen listen_obj)
static

Add a new Listen object to the list of listeners we manage.

Definition at line 49 of file listen.cc.

virtual plugin::Client* drizzled::plugin::Listen::getClient ( int  fd)
pure virtual

This provides a new Client object that can be used by a Session.

Parameters
[in]fdFile descriptor that had activity.

Implemented in drizzle_plugin::ListenMySQLProtocol, drizzle_plugin::mysql_unix_socket_protocol::Protocol, and drizzle_plugin::drizzle_protocol::ListenDrizzleProtocol.

Client * drizzled::plugin::Listen::getClient ( )
static

Accept a new connection (Client object) on one of the configured listener interfaces.

Definition at line 107 of file listen.cc.

virtual bool drizzled::plugin::Listen::getFileDescriptors ( std::vector< int > &  fds)
pure virtual

This provides a list of file descriptors to watch that will trigger new Client instances. When activity is detected on one of the returned file descriptors, getClient will be called with the file descriptor. [out] Vector of file descriptors to watch for activity.

Return values
trueon failure, false on success.

Implemented in drizzled::plugin::ListenTcp, and drizzle_plugin::mysql_unix_socket_protocol::Protocol.

Referenced by setup().

Client * drizzled::plugin::Listen::getNullClient ( )
static

Some internal functions drizzled require a temporary Client object to create a valid session object, this just returns a dummy client object.

Definition at line 151 of file listen.cc.

void drizzled::plugin::Listen::removePlugin ( plugin::Listen listen_obj)
static

Remove a Listen object from the list of listeners we manage.

Definition at line 55 of file listen.cc.

bool drizzled::plugin::Listen::setup ( void  )
static

Setup all configured listen plugins.

Definition at line 60 of file listen.cc.

References getFileDescriptors().

void drizzled::plugin::Listen::shutdown ( )
static

Shutdown and cleanup listen loop for server shutdown.

Definition at line 156 of file listen.cc.


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