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

◆ ServerConnectionState

Enumerator
READ_HEADER 
READ_REQUEST 
WRITE_RESPONSE 

Definition at line 80 of file XmlRpcServerConnection.h.

Constructor & Destructor Documentation

◆ XmlRpcServerConnection()

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

Constructor.

Definition at line 35 of file XmlRpcServerConnection.cpp.

◆ ~XmlRpcServerConnection()

XmlRpcServerConnection::~XmlRpcServerConnection ( )
virtual

Destructor.

Definition at line 47 of file XmlRpcServerConnection.cpp.

Member Function Documentation

◆ executeMethod()

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

Definition at line 270 of file XmlRpcServerConnection.cpp.

◆ executeMulticall()

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

Definition at line 288 of file XmlRpcServerConnection.cpp.

◆ executeRequest()

void XmlRpcServerConnection::executeRequest ( )
protectedvirtual

Definition at line 224 of file XmlRpcServerConnection.cpp.

◆ generateFaultResponse()

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

Definition at line 384 of file XmlRpcServerConnection.cpp.

◆ generateHeader()

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

Definition at line 362 of file XmlRpcServerConnection.cpp.

◆ generateResponse()

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

Definition at line 337 of file XmlRpcServerConnection.cpp.

◆ handleEvent()

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 58 of file XmlRpcServerConnection.cpp.

◆ parseRequest()

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

Definition at line 248 of file XmlRpcServerConnection.cpp.

◆ readHeader()

bool XmlRpcServerConnection::readHeader ( )
protected

Definition at line 75 of file XmlRpcServerConnection.cpp.

◆ readRequest()

bool XmlRpcServerConnection::readRequest ( )
protected

Definition at line 155 of file XmlRpcServerConnection.cpp.

◆ writeResponse()

bool XmlRpcServerConnection::writeResponse ( )
protected

Definition at line 193 of file XmlRpcServerConnection.cpp.

Member Data Documentation

◆ _bytesWritten

int XmlRpc::XmlRpcServerConnection::_bytesWritten
protected

Definition at line 96 of file XmlRpcServerConnection.h.

◆ _connectionState

ServerConnectionState XmlRpc::XmlRpcServerConnection::_connectionState
protected

Definition at line 81 of file XmlRpcServerConnection.h.

◆ _contentLength

int XmlRpc::XmlRpcServerConnection::_contentLength
protected

Definition at line 87 of file XmlRpcServerConnection.h.

◆ _header

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

Definition at line 84 of file XmlRpcServerConnection.h.

◆ _keepAlive

bool XmlRpc::XmlRpcServerConnection::_keepAlive
protected

Definition at line 99 of file XmlRpcServerConnection.h.

◆ _request

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

Definition at line 90 of file XmlRpcServerConnection.h.

◆ _response

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

Definition at line 93 of file XmlRpcServerConnection.h.

◆ _server

XmlRpcServer* XmlRpc::XmlRpcServerConnection::_server
protected

Definition at line 77 of file XmlRpcServerConnection.h.

◆ FAULTCODE

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

Definition at line 39 of file XmlRpcServerConnection.h.

◆ FAULTSTRING

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

Definition at line 40 of file XmlRpcServerConnection.h.

◆ METHODNAME

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

Definition at line 36 of file XmlRpcServerConnection.h.

◆ METHODNAME_TAG

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

Definition at line 29 of file XmlRpcServerConnection.h.

◆ PARAM_ETAG

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

Definition at line 33 of file XmlRpcServerConnection.h.

◆ PARAM_TAG

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

Definition at line 32 of file XmlRpcServerConnection.h.

◆ PARAMS

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

Definition at line 37 of file XmlRpcServerConnection.h.

◆ PARAMS_ETAG

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

Definition at line 31 of file XmlRpcServerConnection.h.

◆ PARAMS_TAG

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

Definition at line 30 of file XmlRpcServerConnection.h.

◆ SYSTEM_MULTICALL

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, Austin Hendrix, Dirk Thomas , Jacob Perron
autogenerated on Thu Nov 23 2023 04:01:41