drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzled::plugin::Listen Class Referenceabstract

#include <listen.h>

Inheritance diagram for drizzled::plugin::Listen:
[legend]
Collaboration diagram for drizzled::plugin::Listen:
[legend]

Public Member Functions

 Listen (std::string name_arg)
std::vector< ListenCounter * > & getListenCounters ()
virtual bool getFileDescriptors (std::vector< int > &fds)=0
virtual plugin::Client * getClient (int fd)=0
Public Member Functions inherited from drizzled::plugin::Plugin
 Plugin (const std::string &name, const std::string &type_name)
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::Client * serveConnections ()
static plugin::Client * getNullClient ()
static void shutdown ()

Protected Attributes

std::vector< ListenCounter * > counters

Additional Inherited Members

Public Types inherited from drizzled::plugin::Plugin
typedef std::pair< const std::string, const std::string > map_key
typedef std::unique_ptr< plugin::Plugin, deleter_fn > owned_ptr
typedef std::map< const map_key, owned_ptr > map
typedef std::vector< Plugin * > vector

Detailed Description

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

Definition at line 36 of file plugin/listen.h.

Constructor & Destructor Documentation

◆ Listen()

drizzled::plugin::Listen::Listen ( std::string name_arg)
inlineexplicit

Definition at line 41 of file plugin/listen.h.

◆ ~Listen()

virtual drizzled::plugin::Listen::~Listen ( )
inlinevirtual

Definition at line 45 of file plugin/listen.h.

Member Function Documentation

◆ addPlugin()

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 64 of file listen.cc.

◆ getClient()

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::drizzle_protocol::ListenDrizzleProtocol, drizzle_plugin::ListenMySQLProtocol, and drizzle_plugin::mysql_unix_socket_protocol::Protocol.

◆ getFileDescriptors()

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. @fds[out] Vector of file descriptors to watch for activity.

Return values
trueon failure, false on success.

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

◆ getListenCounters()

std::vector< ListenCounter * > & drizzled::plugin::Listen::getListenCounters ( )
inline

Definition at line 56 of file plugin/listen.h.

◆ getListenProtocols()

ListenVector & drizzled::plugin::Listen::getListenProtocols ( )
static

Definition at line 59 of file listen.cc.

◆ getNullClient()

Client * 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 184 of file listen.cc.

◆ removePlugin()

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

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

Definition at line 70 of file listen.cc.

◆ serveConnections()

Client * plugin::Listen::serveConnections ( )
static

Listen on configured interfaces and return a Client when a connection is made. This is the primary listen loop.

Definition at line 136 of file listen.cc.

◆ setup()

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

Setup all configured listen plugins.

Definition at line 75 of file listen.cc.

◆ shutdown()

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

Shutdown and cleanup listen loop for server shutdown.

Definition at line 189 of file listen.cc.

Member Data Documentation

◆ counters

std::vector<ListenCounter*> drizzled::plugin::Listen::counters
protected

Definition at line 39 of file plugin/listen.h.


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