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

A class to handle XML RPC requests from a particular client. More...

#include <XmlRpcServerConnection.h>

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

Public Member Functions

virtual unsigned handleEvent (unsigned eventType)
 
 XmlRpcServerConnection (int fd, XmlRpcServer *server, bool deleteOnClose=false)
 Constructor. More...
 
virtual ~XmlRpcServerConnection ()
 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...
 

Static Public Attributes

static const std::string FAULTCODE = "faultCode"
 
static const std::string FAULTSTRING = "faultString"
 
static const std::string METHODNAME = "methodName"
 
static const char METHODNAME_TAG [] = "<methodName>"
 
static const char PARAM_ETAG [] = "</param>"
 
static const char PARAM_TAG [] = "<param>"
 
static const std::string PARAMS = "params"
 
static const char PARAMS_ETAG [] = "</params>"
 
static const char PARAMS_TAG [] = "<params>"
 
static const std::string SYSTEM_MULTICALL = "system.multicall"
 

Protected Types

enum  ServerConnectionState { READ_HEADER, READ_REQUEST, WRITE_RESPONSE }
 

Protected Member Functions

bool executeMethod (const std::string &methodName, XmlRpcValue &params, XmlRpcValue &result)
 
bool executeMulticall (const std::string &methodName, XmlRpcValue &params, XmlRpcValue &result)
 
virtual void executeRequest ()
 
void generateFaultResponse (std::string const &msg, int errorCode=-1)
 
std::string generateHeader (std::string const &body)
 
void generateResponse (std::string const &resultXml)
 
std::string parseRequest (XmlRpcValue &params)
 
bool readHeader ()
 
bool readRequest ()
 
bool writeResponse ()
 

Protected Attributes

int _bytesWritten
 
ServerConnectionState _connectionState
 
int _contentLength
 
std::string _header
 
bool _keepAlive
 
std::string _request
 
std::string _response
 
XmlRpcServer_server
 

Detailed Description

A class to handle XML RPC requests from a particular client.

Definition at line 26 of file XmlRpcServerConnection.h.

Member Enumeration Documentation

Enumerator
READ_HEADER 
READ_REQUEST 
WRITE_RESPONSE 

Definition at line 80 of file XmlRpcServerConnection.h.

Constructor & Destructor Documentation

XmlRpcServerConnection::XmlRpcServerConnection ( int  fd,
XmlRpcServer server,
bool  deleteOnClose = false 
)

Constructor.

Definition at line 34 of file XmlRpcServerConnection.cpp.

XmlRpcServerConnection::~XmlRpcServerConnection ( )
virtual

Destructor.

Definition at line 46 of file XmlRpcServerConnection.cpp.

Member Function Documentation

bool XmlRpcServerConnection::executeMethod ( const std::string &  methodName,
XmlRpcValue params,
XmlRpcValue result 
)
protected

Definition at line 259 of file XmlRpcServerConnection.cpp.

bool XmlRpcServerConnection::executeMulticall ( const std::string &  methodName,
XmlRpcValue params,
XmlRpcValue result 
)
protected

Definition at line 277 of file XmlRpcServerConnection.cpp.

void XmlRpcServerConnection::executeRequest ( )
protectedvirtual

Definition at line 213 of file XmlRpcServerConnection.cpp.

void XmlRpcServerConnection::generateFaultResponse ( std::string const &  msg,
int  errorCode = -1 
)
protected

Definition at line 365 of file XmlRpcServerConnection.cpp.

std::string XmlRpcServerConnection::generateHeader ( std::string const &  body)
protected

Definition at line 343 of file XmlRpcServerConnection.cpp.

void XmlRpcServerConnection::generateResponse ( std::string const &  resultXml)
protected

Definition at line 326 of file XmlRpcServerConnection.cpp.

unsigned XmlRpcServerConnection::handleEvent ( unsigned  eventType)
virtual

Handle IO on the client connection socket.

Parameters
eventTypeType of IO event that occurred.
See also
XmlRpcDispatch::EventType.

Implements XmlRpc::XmlRpcSource.

Definition at line 57 of file XmlRpcServerConnection.cpp.

std::string XmlRpcServerConnection::parseRequest ( XmlRpcValue params)
protected

Definition at line 237 of file XmlRpcServerConnection.cpp.

bool XmlRpcServerConnection::readHeader ( )
protected

Definition at line 74 of file XmlRpcServerConnection.cpp.

bool XmlRpcServerConnection::readRequest ( )
protected

Definition at line 151 of file XmlRpcServerConnection.cpp.

bool XmlRpcServerConnection::writeResponse ( )
protected

Definition at line 182 of file XmlRpcServerConnection.cpp.

Member Data Documentation

int XmlRpc::XmlRpcServerConnection::_bytesWritten
protected

Definition at line 96 of file XmlRpcServerConnection.h.

ServerConnectionState XmlRpc::XmlRpcServerConnection::_connectionState
protected

Definition at line 81 of file XmlRpcServerConnection.h.

int XmlRpc::XmlRpcServerConnection::_contentLength
protected

Definition at line 87 of file XmlRpcServerConnection.h.

std::string XmlRpc::XmlRpcServerConnection::_header
protected

Definition at line 84 of file XmlRpcServerConnection.h.

bool XmlRpc::XmlRpcServerConnection::_keepAlive
protected

Definition at line 99 of file XmlRpcServerConnection.h.

std::string XmlRpc::XmlRpcServerConnection::_request
protected

Definition at line 90 of file XmlRpcServerConnection.h.

std::string XmlRpc::XmlRpcServerConnection::_response
protected

Definition at line 93 of file XmlRpcServerConnection.h.

XmlRpcServer* XmlRpc::XmlRpcServerConnection::_server
protected

Definition at line 77 of file XmlRpcServerConnection.h.

const std::string XmlRpcServerConnection::FAULTCODE = "faultCode"
static

Definition at line 39 of file XmlRpcServerConnection.h.

const std::string XmlRpcServerConnection::FAULTSTRING = "faultString"
static

Definition at line 40 of file XmlRpcServerConnection.h.

const std::string XmlRpcServerConnection::METHODNAME = "methodName"
static

Definition at line 36 of file XmlRpcServerConnection.h.

const char XmlRpcServerConnection::METHODNAME_TAG = "<methodName>"
static

Definition at line 29 of file XmlRpcServerConnection.h.

const char XmlRpcServerConnection::PARAM_ETAG = "</param>"
static

Definition at line 33 of file XmlRpcServerConnection.h.

const char XmlRpcServerConnection::PARAM_TAG = "<param>"
static

Definition at line 32 of file XmlRpcServerConnection.h.

const std::string XmlRpcServerConnection::PARAMS = "params"
static

Definition at line 37 of file XmlRpcServerConnection.h.

const char XmlRpcServerConnection::PARAMS_ETAG = "</params>"
static

Definition at line 31 of file XmlRpcServerConnection.h.

const char XmlRpcServerConnection::PARAMS_TAG = "<params>"
static

Definition at line 30 of file XmlRpcServerConnection.h.

const std::string XmlRpcServerConnection::SYSTEM_MULTICALL = "system.multicall"
static

Definition at line 35 of file XmlRpcServerConnection.h.


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


xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley
autogenerated on Sat Oct 5 2019 03:58:22