A class to handle XML RPC requests. More...
#include <XmlRpcServer.h>
Public Member Functions | |
void | addMethod (XmlRpcServerMethod *method) |
Add a command to the RPC server. | |
bool | bindAndListen (int port, int backlog=5) |
void | enableIntrospection (bool enabled=true) |
Specify whether introspection is enabled or not. Default is not enabled. | |
void | exit () |
Temporarily stop processing client requests and exit the work() method. | |
XmlRpcServerMethod * | findMethod (const std::string &name) const |
Look up a method by name. | |
XmlRpcDispatch * | get_dispatch () |
int | get_port () |
virtual unsigned | handleEvent (unsigned eventType) |
Handle client connection requests. | |
void | listMethods (XmlRpcValue &result) |
Introspection support. | |
virtual void | removeConnection (XmlRpcServerConnection *) |
Remove a connection from the dispatcher. | |
void | removeMethod (XmlRpcServerMethod *method) |
Remove a command from the RPC server. | |
void | removeMethod (const std::string &methodName) |
Remove a command from the RPC server by name. | |
void | shutdown () |
Close all connections with clients and the socket file descriptor. | |
void | work (double msTime) |
Process client requests for the specified time. | |
XmlRpcServer () | |
Create a server object. | |
virtual | ~XmlRpcServer () |
Destructor. | |
Protected Types | |
typedef std::map< std::string, XmlRpcServerMethod * > | MethodMap |
Protected Member Functions | |
virtual void | acceptConnection () |
Accept a client connection request. | |
virtual XmlRpcServerConnection * | createConnection (int socket) |
Create a new connection object for processing requests from a specific client. | |
Protected Attributes | |
XmlRpcDispatch | _disp |
bool | _introspectionEnabled |
XmlRpcServerMethod * | _listMethods |
XmlRpcServerMethod * | _methodHelp |
MethodMap | _methods |
int | _port |
A class to handle XML RPC requests.
Definition at line 37 of file XmlRpcServer.h.
typedef std::map< std::string, XmlRpcServerMethod* > XmlRpc::XmlRpcServer::MethodMap [protected] |
Definition at line 102 of file XmlRpcServer.h.
Create a server object.
Definition at line 16 of file XmlRpcServer.cpp.
XmlRpcServer::~XmlRpcServer | ( | ) | [virtual] |
Destructor.
Definition at line 24 of file XmlRpcServer.cpp.
void XmlRpcServer::acceptConnection | ( | ) | [protected, virtual] |
Accept a client connection request.
Definition at line 150 of file XmlRpcServer.cpp.
void XmlRpcServer::addMethod | ( | XmlRpcServerMethod * | method | ) |
Add a command to the RPC server.
Definition at line 35 of file XmlRpcServer.cpp.
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 73 of file XmlRpcServer.cpp.
XmlRpcServerConnection * XmlRpcServer::createConnection | ( | int | socket | ) | [protected, virtual] |
Create a new connection object for processing requests from a specific client.
Definition at line 174 of file XmlRpcServer.cpp.
void XmlRpcServer::enableIntrospection | ( | bool | enabled = true | ) |
Specify whether introspection is enabled or not. Default is not enabled.
Definition at line 250 of file XmlRpcServer.cpp.
void XmlRpcServer::exit | ( | ) |
Temporarily stop processing client requests and exit the work() method.
Definition at line 190 of file XmlRpcServer.cpp.
XmlRpcServerMethod * XmlRpcServer::findMethod | ( | const std::string & | name | ) | const |
Look up a method by name.
Definition at line 61 of file XmlRpcServer.cpp.
XmlRpcDispatch* XmlRpc::XmlRpcServer::get_dispatch | ( | ) | [inline] |
Definition at line 85 of file XmlRpcServer.h.
int XmlRpc::XmlRpcServer::get_port | ( | ) | [inline] |
Definition at line 83 of file XmlRpcServer.h.
unsigned XmlRpcServer::handleEvent | ( | unsigned | eventType | ) | [virtual] |
Handle client connection requests.
Implements XmlRpc::XmlRpcSource.
Definition at line 140 of file XmlRpcServer.cpp.
void XmlRpcServer::listMethods | ( | XmlRpcValue & | result | ) |
Introspection support.
Definition at line 277 of file XmlRpcServer.cpp.
void XmlRpcServer::removeConnection | ( | XmlRpcServerConnection * | sc | ) | [virtual] |
Remove a connection from the dispatcher.
Definition at line 182 of file XmlRpcServer.cpp.
void XmlRpcServer::removeMethod | ( | XmlRpcServerMethod * | method | ) |
Remove a command from the RPC server.
Definition at line 42 of file XmlRpcServer.cpp.
void XmlRpcServer::removeMethod | ( | const std::string & | methodName | ) |
Remove a command from the RPC server by name.
Definition at line 51 of file XmlRpcServer.cpp.
void XmlRpcServer::shutdown | ( | ) |
Close all connections with clients and the socket file descriptor.
Definition at line 198 of file XmlRpcServer.cpp.
void XmlRpcServer::work | ( | double | msTime | ) |
Process client requests for the specified time.
Definition at line 129 of file XmlRpcServer.cpp.
XmlRpcDispatch XmlRpc::XmlRpcServer::_disp [protected] |
Definition at line 99 of file XmlRpcServer.h.
bool XmlRpc::XmlRpcServer::_introspectionEnabled [protected] |
Definition at line 96 of file XmlRpcServer.h.
XmlRpcServerMethod* XmlRpc::XmlRpcServer::_listMethods [protected] |
Definition at line 106 of file XmlRpcServer.h.
XmlRpcServerMethod* XmlRpc::XmlRpcServer::_methodHelp [protected] |
Definition at line 107 of file XmlRpcServer.h.
MethodMap XmlRpc::XmlRpcServer::_methods [protected] |
Definition at line 103 of file XmlRpcServer.h.
int XmlRpc::XmlRpcServer::_port [protected] |
Definition at line 109 of file XmlRpcServer.h.