XmlRpc::XmlRpcSource Class Reference

#include <XmlRpcSource.h>

Inheritance diagram for XmlRpc::XmlRpcSource:

XmlRpc::XmlRpcClient XmlRpc::XmlRpcServer XmlRpc::XmlRpcServerConnection XmlRpc::XmlRpcThreadedServer XmlRpcInterface

List of all members.


Detailed Description

An RPC source represents a file descriptor to monitor.

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

Constructor & Destructor Documentation

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

Constructor.

Parameters:
fd The socket file descriptor to monitor.
deleteOnClose If true, the object deletes itself when close is called.
00010     : _fd(fd), _deleteOnClose(deleteOnClose), _keepOpen(false)
00011   {
00012   }

XmlRpc::XmlRpcSource::~XmlRpcSource (  )  [virtual]

Destructor.

00015   {
00016   }


Member Function Documentation

int XmlRpc::XmlRpcSource::getfd (  )  const [inline]

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

Specify the file descriptor to monitor.

Referenced by XmlRpc::XmlRpcServer::bindAndListen(), and XmlRpc::XmlRpcClient::doConnect().

00053 { _fd = fd; }

bool XmlRpc::XmlRpcSource::getKeepOpen (  )  const [inline]

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

Referenced by XmlRpc::XmlRpcClient::readHeader(), and XmlRpc::XmlRpcDispatch::waitForAndProcessEvents().

00056 { return _keepOpen; }

void XmlRpc::XmlRpcSource::setKeepOpen ( bool  b = true  )  [inline]

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

Referenced by XmlRpc::XmlRpcClient::XmlRpcClient().

00058 { _keepOpen = b; }

void XmlRpc::XmlRpcSource::close (  )  [virtual]

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

Reimplemented in XmlRpc::XmlRpcClient.

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

00021   {
00022     if (_fd != -1) {
00023       XmlRpcUtil::log(2,"XmlRpcSource::close: closing socket %d.", _fd);
00024       XmlRpcSocket::close(_fd);
00025       XmlRpcUtil::log(2,"XmlRpcSource::close: done closing socket %d.", _fd);
00026       _fd = -1;
00027     }
00028     if (_deleteOnClose) {
00029       XmlRpcUtil::log(2,"XmlRpcSource::close: deleting this");
00030       _deleteOnClose = false;
00031       delete this;
00032     }
00033 #ifdef USE_SSL
00034     if (_ssl_ssl != (SSL *) NULL) {
00035       SSL_shutdown (_ssl_ssl);
00036       SSL_free (_ssl_ssl);
00037       SSL_CTX_free (_ssl_ctx);
00038     }
00039 #endif
00040   }

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().


Member Data Documentation

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

Referenced by close().

Referenced by getKeepOpen(), and setKeepOpen().


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

Generated on Fri Sep 19 13:05:09 2008 for ITM OverSim by  doxygen 1.5.5