OverSim
XmlRpc::XmlRpcSource Class Reference

An RPC source represents a file descriptor to monitor. More...

#include <XmlRpcSource.h>

Inheritance diagram for XmlRpc::XmlRpcSource:
XmlRpc::XmlRpcClient XmlRpc::XmlRpcServer XmlRpc::XmlRpcServerConnection XmlRpc::XmlRpcThreadedServer XmlRpcInterface

Public Member Functions

 XmlRpcSource (int fd=-1, bool deleteOnClose=false)
 Constructor.
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.
virtual unsigned handleEvent (unsigned eventType)=0
 Return true to continue monitoring this source.

Public Attributes

bool _ssl
SSL_CTX_ssl_ctx
SSL_ssl_ssl
SSL_METHOD_ssl_meth

Private Attributes

int _fd
bool _deleteOnClose
bool _keepOpen

Detailed Description

An RPC source represents a file descriptor to monitor.

Definition at line 46 of file XmlRpcSource.h.

Constructor & Destructor Documentation

XmlRpc::XmlRpcSource::XmlRpcSource ( int  fd = -1,
bool  deleteOnClose = false 
)

Constructor.

Parameters
fdThe socket file descriptor to monitor.
deleteOnCloseIf true, the object deletes itself when close is called.

Definition at line 14 of file XmlRpcSource.cc.

: _fd(fd), _deleteOnClose(deleteOnClose), _keepOpen(false)
{
}
XmlRpc::XmlRpcSource::~XmlRpcSource ( )
virtual

Destructor.

Definition at line 19 of file XmlRpcSource.cc.

{
}

Member Function Documentation

void XmlRpc::XmlRpcSource::close ( )
virtual

Close the owned fd. If deleteOnClose was specified at construction, the object is deleted.

Reimplemented in XmlRpc::XmlRpcClient.

Definition at line 25 of file XmlRpcSource.cc.

Referenced by XmlRpc::XmlRpcServer::acceptConnection(), XmlRpc::XmlRpcServer::bindAndListen(), XmlRpc::XmlRpcClient::close(), XmlRpc::XmlRpcClient::readHeader(), XmlRpc::XmlRpcDispatch::waitForAndProcessEvents(), and XmlRpc::XmlRpcDispatch::work().

{
if (_fd != -1) {
XmlRpcUtil::log(2,"XmlRpcSource::close: closing socket %d.", _fd);
XmlRpcUtil::log(2,"XmlRpcSource::close: done closing socket %d.", _fd);
_fd = -1;
}
XmlRpcUtil::log(2,"XmlRpcSource::close: deleting this");
_deleteOnClose = false;
delete this;
}
#ifdef USE_SSL
if (_ssl_ssl != (SSL *) NULL) {
}
#endif
}
bool XmlRpc::XmlRpcSource::getKeepOpen ( ) const
inline

Return whether the file descriptor should be kept open if it is no longer monitored.

Definition at line 62 of file XmlRpcSource.h.

Referenced by XmlRpc::XmlRpcDispatch::waitForAndProcessEvents().

{ return _keepOpen; }
virtual unsigned XmlRpc::XmlRpcSource::handleEvent ( unsigned  eventType)
pure virtual

Return true to continue monitoring this source.

Implemented in XmlRpc::XmlRpcClient, XmlRpc::XmlRpcServer, and XmlRpc::XmlRpcServerConnection.

Referenced by XmlRpc::XmlRpcDispatch::waitForAndProcessEvents().

void XmlRpc::XmlRpcSource::setfd ( int  fd)
inline

Specify the file descriptor to monitor.

Definition at line 59 of file XmlRpcSource.h.

Referenced by XmlRpc::XmlRpcServer::bindAndListen().

{ _fd = fd; }
void XmlRpc::XmlRpcSource::setKeepOpen ( bool  b = true)
inline

Specify whether the file descriptor should be kept open if it is no longer monitored.

Definition at line 64 of file XmlRpcSource.h.

{ _keepOpen = b; }

Member Data Documentation

bool XmlRpc::XmlRpcSource::_deleteOnClose
private

Definition at line 85 of file XmlRpcSource.h.

Referenced by close().

int XmlRpc::XmlRpcSource::_fd
private

Definition at line 80 of file XmlRpcSource.h.

Referenced by close(), getfd(), and setfd().

bool XmlRpc::XmlRpcSource::_keepOpen
private

Definition at line 88 of file XmlRpcSource.h.

Referenced by getKeepOpen(), and setKeepOpen().

bool XmlRpc::XmlRpcSource::_ssl

Definition at line 73 of file XmlRpcSource.h.

SSL_CTX* XmlRpc::XmlRpcSource::_ssl_ctx

Definition at line 74 of file XmlRpcSource.h.

Referenced by close().

SSL_METHOD* XmlRpc::XmlRpcSource::_ssl_meth

Definition at line 76 of file XmlRpcSource.h.


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