Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
XmlRpc::XmlRpcServer Class Reference

A class to handle XML RPC requests. More...

#include <XmlRpcServer.h>

Inheritance diagram for XmlRpc::XmlRpcServer:
Inheritance graph
[legend]

Public Member Functions

void addMethod (XmlRpcServerMethod *method)
 Add a command to the RPC server. More...
 
bool bindAndListen (int port, int backlog=5)
 
void enableIntrospection (bool enabled=true)
 Specify whether introspection is enabled or not. Default is not enabled. More...
 
void exit ()
 Temporarily stop processing client requests and exit the work() method. More...
 
XmlRpcServerMethodfindMethod (const std::string &name) const
 Look up a method by name. More...
 
XmlRpcDispatchget_dispatch ()
 
int get_port ()
 
virtual unsigned handleEvent (unsigned eventType)
 Handle client connection requests. More...
 
void listMethods (XmlRpcValue &result)
 Introspection support. More...
 
virtual void removeConnection (XmlRpcServerConnection *)
 Remove a connection from the dispatcher. More...
 
void removeMethod (XmlRpcServerMethod *method)
 Remove a command from the RPC server. More...
 
void removeMethod (const std::string &methodName)
 Remove a command from the RPC server by name. More...
 
void shutdown ()
 Close all connections with clients and the socket file descriptor. More...
 
void work (double msTime)
 Process client requests for the specified time. More...
 
 XmlRpcServer ()
 Create a server object. More...
 
virtual ~XmlRpcServer ()
 Destructor. More...
 
- Public Member Functions inherited from XmlRpc::XmlRpcSource
virtual void close ()
 Close the owned fd. If deleteOnClose was specified at construction, the object is deleted. More...
 
int getfd () const
 Return the file descriptor being monitored. More...
 
bool getKeepOpen () const
 Return whether the file descriptor should be kept open if it is no longer monitored. More...
 
void setfd (int fd)
 Specify the file descriptor to monitor. More...
 
void setKeepOpen (bool b=true)
 Specify whether the file descriptor should be kept open if it is no longer monitored. More...
 
 XmlRpcSource (int fd=-1, bool deleteOnClose=false)
 
virtual ~XmlRpcSource ()
 Destructor. More...
 

Protected Types

typedef std::map< std::string, XmlRpcServerMethod *> MethodMap
 

Protected Member Functions

virtual unsigned acceptConnection ()
 Accept a client connection request. More...
 
virtual XmlRpcServerConnectioncreateConnection (int socket)
 Create a new connection object for processing requests from a specific client. More...
 
bool enoughFreeFDs ()
 Check if enough number of free file descriptors. More...
 

Protected Attributes

bool _accept_error
 
double _accept_retry_time_sec
 
XmlRpcDispatch _disp
 
bool _introspectionEnabled
 
XmlRpcServerMethod_listMethods
 
XmlRpcServerMethod_methodHelp
 
MethodMap _methods
 
int _port
 
std::vector< struct pollfd > pollfds
 

Static Protected Attributes

static const double ACCEPT_RETRY_INTERVAL_SEC = 1.0
 
static const int FREE_FD_BUFFER = 32
 

Detailed Description

A class to handle XML RPC requests.

Definition at line 41 of file XmlRpcServer.h.

Member Typedef Documentation

◆ MethodMap

typedef std::map< std::string, XmlRpcServerMethod* > XmlRpc::XmlRpcServer::MethodMap
protected

Definition at line 109 of file XmlRpcServer.h.

Constructor & Destructor Documentation

◆ XmlRpcServer()

XmlRpcServer::XmlRpcServer ( )

Create a server object.

Definition at line 25 of file XmlRpcServer.cpp.

◆ ~XmlRpcServer()

XmlRpcServer::~XmlRpcServer ( )
virtual

Destructor.

Definition at line 58 of file XmlRpcServer.cpp.

Member Function Documentation

◆ acceptConnection()

unsigned XmlRpcServer::acceptConnection ( )
protectedvirtual

Accept a client connection request.

Definition at line 186 of file XmlRpcServer.cpp.

◆ addMethod()

void XmlRpcServer::addMethod ( XmlRpcServerMethod method)

Add a command to the RPC server.

Definition at line 69 of file XmlRpcServer.cpp.

◆ bindAndListen()

bool XmlRpcServer::bindAndListen ( int  port,
int  backlog = 5 
)

Create a socket, bind to the specified port, and set it in listen mode to make it available for clients.

Definition at line 107 of file XmlRpcServer.cpp.

◆ createConnection()

XmlRpcServerConnection * XmlRpcServer::createConnection ( int  socket)
protectedvirtual

Create a new connection object for processing requests from a specific client.

Definition at line 275 of file XmlRpcServer.cpp.

◆ enableIntrospection()

void XmlRpcServer::enableIntrospection ( bool  enabled = true)

Specify whether introspection is enabled or not. Default is not enabled.

Definition at line 351 of file XmlRpcServer.cpp.

◆ enoughFreeFDs()

bool XmlRpcServer::enoughFreeFDs ( )
protected

Check if enough number of free file descriptors.

Definition at line 219 of file XmlRpcServer.cpp.

◆ exit()

void XmlRpcServer::exit ( )

Temporarily stop processing client requests and exit the work() method.

Definition at line 291 of file XmlRpcServer.cpp.

◆ findMethod()

XmlRpcServerMethod * XmlRpcServer::findMethod ( const std::string &  name) const

Look up a method by name.

Definition at line 95 of file XmlRpcServer.cpp.

◆ get_dispatch()

XmlRpcDispatch* XmlRpc::XmlRpcServer::get_dispatch ( )
inline

Definition at line 89 of file XmlRpcServer.h.

◆ get_port()

int XmlRpc::XmlRpcServer::get_port ( )
inline

Definition at line 87 of file XmlRpcServer.h.

◆ handleEvent()

unsigned XmlRpcServer::handleEvent ( unsigned  eventType)
virtual

Handle client connection requests.

Implements XmlRpc::XmlRpcSource.

Definition at line 177 of file XmlRpcServer.cpp.

◆ listMethods()

void XmlRpcServer::listMethods ( XmlRpcValue result)

Introspection support.

Definition at line 378 of file XmlRpcServer.cpp.

◆ removeConnection()

void XmlRpcServer::removeConnection ( XmlRpcServerConnection sc)
virtual

Remove a connection from the dispatcher.

Definition at line 283 of file XmlRpcServer.cpp.

◆ removeMethod() [1/2]

void XmlRpcServer::removeMethod ( XmlRpcServerMethod method)

Remove a command from the RPC server.

Definition at line 76 of file XmlRpcServer.cpp.

◆ removeMethod() [2/2]

void XmlRpcServer::removeMethod ( const std::string &  methodName)

Remove a command from the RPC server by name.

Definition at line 85 of file XmlRpcServer.cpp.

◆ shutdown()

void XmlRpcServer::shutdown ( )

Close all connections with clients and the socket file descriptor.

Definition at line 299 of file XmlRpcServer.cpp.

◆ work()

void XmlRpcServer::work ( double  msTime)

Process client requests for the specified time.

Definition at line 163 of file XmlRpcServer.cpp.

Member Data Documentation

◆ _accept_error

bool XmlRpc::XmlRpcServer::_accept_error
protected

Definition at line 119 of file XmlRpcServer.h.

◆ _accept_retry_time_sec

double XmlRpc::XmlRpcServer::_accept_retry_time_sec
protected

Definition at line 124 of file XmlRpcServer.h.

◆ _disp

XmlRpcDispatch XmlRpc::XmlRpcServer::_disp
protected

Definition at line 106 of file XmlRpcServer.h.

◆ _introspectionEnabled

bool XmlRpc::XmlRpcServer::_introspectionEnabled
protected

Definition at line 103 of file XmlRpcServer.h.

◆ _listMethods

XmlRpcServerMethod* XmlRpc::XmlRpcServer::_listMethods
protected

Definition at line 113 of file XmlRpcServer.h.

◆ _methodHelp

XmlRpcServerMethod* XmlRpc::XmlRpcServer::_methodHelp
protected

Definition at line 114 of file XmlRpcServer.h.

◆ _methods

MethodMap XmlRpc::XmlRpcServer::_methods
protected

Definition at line 110 of file XmlRpcServer.h.

◆ _port

int XmlRpc::XmlRpcServer::_port
protected

Definition at line 116 of file XmlRpcServer.h.

◆ ACCEPT_RETRY_INTERVAL_SEC

const double XmlRpcServer::ACCEPT_RETRY_INTERVAL_SEC = 1.0
staticprotected

Definition at line 122 of file XmlRpcServer.h.

◆ FREE_FD_BUFFER

const int XmlRpcServer::FREE_FD_BUFFER = 32
staticprotected

Definition at line 127 of file XmlRpcServer.h.

◆ pollfds

std::vector<struct pollfd> XmlRpc::XmlRpcServer::pollfds
protected

Definition at line 130 of file XmlRpcServer.h.


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


xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley, Austin Hendrix, Dirk Thomas
autogenerated on Mon Feb 28 2022 23:33:22