BOSS 7.1.2
BESIII Offline Software System
|
A class to handle XML RPC requests. More...
#include <XmlRpcServer.h>
Public Member Functions | |
XmlRpcServer () | |
Create a server object. | |
virtual | ~XmlRpcServer () |
Destructor. | |
void | enableIntrospection (bool enabled=true) |
Specify whether introspection is enabled or not. Default is not enabled. | |
void | addMethod (XmlRpcServerMethod *method) |
Add a command to the RPC server. | |
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. | |
XmlRpcServerMethod * | findMethod (const std::string &name) const |
Look up a method by name. | |
bool | bindAndListen (int port, int backlog=5) |
void | work (double msTime) |
Process client requests for the specified time. | |
void | exit () |
Temporarily stop processing client requests and exit the work() method. | |
void | shutdown () |
Close all connections with clients and the socket file descriptor. | |
void | listMethods (XmlRpcValue &result) |
Introspection support. | |
virtual unsigned | handleEvent (unsigned eventType) |
Handle client connection requests. | |
virtual void | removeConnection (XmlRpcServerConnection *) |
Remove a connection from the dispatcher. | |
Public Member Functions inherited from XmlRpc::XmlRpcSource | |
XmlRpcSource (int fd=-1, bool deleteOnClose=false) | |
virtual | ~XmlRpcSource () |
Destructor. | |
int | getfd () const |
Return the file descriptor being monitored. | |
void | setfd (int fd) |
Specify the file descriptor to monitor. | |
bool | getKeepOpen () const |
Return whether the file descriptor should be kept open if it is no longer monitored. | |
void | setKeepOpen (bool b=true) |
Specify whether the file descriptor should be kept open if it is no longer monitored. | |
virtual void | close () |
Close the owned fd. If deleteOnClose was specified at construction, the object is deleted. | |
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 | |
bool | _introspectionEnabled |
XmlRpcDispatch | _disp |
MethodMap | _methods |
XmlRpcServerMethod * | _listMethods |
XmlRpcServerMethod * | _methodHelp |
A class to handle XML RPC requests.
Definition at line 33 of file XmlRpcServer.h.
|
protected |
Definition at line 94 of file XmlRpcServer.h.
XmlRpcServer::XmlRpcServer | ( | ) |
Create a server object.
Definition at line 13 of file XmlRpcServer.cpp.
|
virtual |
Destructor.
Definition at line 21 of file XmlRpcServer.cpp.
|
protectedvirtual |
Accept a client connection request.
Definition at line 145 of file XmlRpcServer.cpp.
Referenced by handleEvent().
void XmlRpcServer::addMethod | ( | XmlRpcServerMethod * | method | ) |
Add a command to the RPC server.
Definition at line 32 of file XmlRpcServer.cpp.
Referenced by enableIntrospection(), and XmlRpc::XmlRpcServerMethod::XmlRpcServerMethod().
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 70 of file XmlRpcServer.cpp.
|
protectedvirtual |
Create a new connection object for processing requests from a specific client.
Definition at line 169 of file XmlRpcServer.cpp.
Referenced by acceptConnection().
Specify whether introspection is enabled or not. Default is not enabled.
Definition at line 245 of file XmlRpcServer.cpp.
Referenced by main().
void XmlRpcServer::exit | ( | ) |
Temporarily stop processing client requests and exit the work() method.
Definition at line 185 of file XmlRpcServer.cpp.
XmlRpcServerMethod * XmlRpcServer::findMethod | ( | const std::string & | name | ) | const |
Look up a method by name.
Definition at line 58 of file XmlRpcServer.cpp.
Referenced by XmlRpc::XmlRpcServerConnection::executeMethod().
|
virtual |
Handle client connection requests.
Implements XmlRpc::XmlRpcSource.
Definition at line 135 of file XmlRpcServer.cpp.
void XmlRpcServer::listMethods | ( | XmlRpcValue & | result | ) |
Introspection support.
Definition at line 272 of file XmlRpcServer.cpp.
|
virtual |
Remove a connection from the dispatcher.
Definition at line 177 of file XmlRpcServer.cpp.
Referenced by XmlRpc::XmlRpcServerConnection::~XmlRpcServerConnection().
void XmlRpcServer::removeMethod | ( | const std::string & | methodName | ) |
Remove a command from the RPC server by name.
Definition at line 48 of file XmlRpcServer.cpp.
void XmlRpcServer::removeMethod | ( | XmlRpcServerMethod * | method | ) |
Remove a command from the RPC server.
Definition at line 39 of file XmlRpcServer.cpp.
Referenced by enableIntrospection(), and XmlRpc::XmlRpcServerMethod::~XmlRpcServerMethod().
void XmlRpcServer::shutdown | ( | ) |
Close all connections with clients and the socket file descriptor.
Definition at line 193 of file XmlRpcServer.cpp.
Referenced by ~XmlRpcServer().
void XmlRpcServer::work | ( | double | msTime | ) |
Process client requests for the specified time.
Definition at line 124 of file XmlRpcServer.cpp.
|
protected |
Definition at line 91 of file XmlRpcServer.h.
Referenced by acceptConnection(), bindAndListen(), exit(), removeConnection(), shutdown(), and work().
|
protected |
Definition at line 88 of file XmlRpcServer.h.
Referenced by enableIntrospection(), and XmlRpcServer().
|
protected |
Definition at line 98 of file XmlRpcServer.h.
Referenced by enableIntrospection(), XmlRpcServer(), and ~XmlRpcServer().
|
protected |
Definition at line 99 of file XmlRpcServer.h.
Referenced by enableIntrospection(), XmlRpcServer(), and ~XmlRpcServer().
|
protected |
Definition at line 95 of file XmlRpcServer.h.
Referenced by addMethod(), findMethod(), listMethods(), removeMethod(), removeMethod(), and ~XmlRpcServer().