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. 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... | |
XmlRpcServerMethod * | findMethod (const std::string &name) const |
Look up a method by name. More... | |
XmlRpcDispatch * | get_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 void | acceptConnection () |
Accept a client connection request. More... | |
virtual XmlRpcServerConnection * | createConnection (int socket) |
Create a new connection object for processing requests from a specific client. More... | |
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.
|
protected |
Definition at line 102 of file XmlRpcServer.h.
XmlRpcServer::XmlRpcServer | ( | ) |
Create a server object.
Definition at line 16 of file XmlRpcServer.cpp.
|
virtual |
Destructor.
Definition at line 25 of file XmlRpcServer.cpp.
|
protectedvirtual |
Accept a client connection request.
Definition at line 151 of file XmlRpcServer.cpp.
void XmlRpcServer::addMethod | ( | XmlRpcServerMethod * | method | ) |
Add a command to the RPC server.
Definition at line 36 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 74 of file XmlRpcServer.cpp.
|
protectedvirtual |
Create a new connection object for processing requests from a specific client.
Definition at line 175 of file XmlRpcServer.cpp.
void XmlRpcServer::enableIntrospection | ( | bool | enabled = true | ) |
Specify whether introspection is enabled or not. Default is not enabled.
Definition at line 251 of file XmlRpcServer.cpp.
void XmlRpcServer::exit | ( | ) |
Temporarily stop processing client requests and exit the work() method.
Definition at line 191 of file XmlRpcServer.cpp.
XmlRpcServerMethod * XmlRpcServer::findMethod | ( | const std::string & | name | ) | const |
Look up a method by name.
Definition at line 62 of file XmlRpcServer.cpp.
|
inline |
Definition at line 85 of file XmlRpcServer.h.
|
inline |
Definition at line 83 of file XmlRpcServer.h.
|
virtual |
Handle client connection requests.
Implements XmlRpc::XmlRpcSource.
Definition at line 141 of file XmlRpcServer.cpp.
void XmlRpcServer::listMethods | ( | XmlRpcValue & | result | ) |
Introspection support.
Definition at line 278 of file XmlRpcServer.cpp.
|
virtual |
Remove a connection from the dispatcher.
Definition at line 183 of file XmlRpcServer.cpp.
void XmlRpcServer::removeMethod | ( | XmlRpcServerMethod * | method | ) |
Remove a command from the RPC server.
Definition at line 43 of file XmlRpcServer.cpp.
void XmlRpcServer::removeMethod | ( | const std::string & | methodName | ) |
Remove a command from the RPC server by name.
Definition at line 52 of file XmlRpcServer.cpp.
void XmlRpcServer::shutdown | ( | ) |
Close all connections with clients and the socket file descriptor.
Definition at line 199 of file XmlRpcServer.cpp.
void XmlRpcServer::work | ( | double | msTime | ) |
Process client requests for the specified time.
Definition at line 130 of file XmlRpcServer.cpp.
|
protected |
Definition at line 99 of file XmlRpcServer.h.
|
protected |
Definition at line 96 of file XmlRpcServer.h.
|
protected |
Definition at line 106 of file XmlRpcServer.h.
|
protected |
Definition at line 107 of file XmlRpcServer.h.
|
protected |
Definition at line 103 of file XmlRpcServer.h.
|
protected |
Definition at line 109 of file XmlRpcServer.h.