XmlRpc::XmlRpcSource Class Reference

#include <XmlRpcSource.h>

Inheritance diagram for XmlRpc::XmlRpcSource:

XmlRpc::XmlRpcClient XmlRpc::XmlRpcServer XmlRpc::XmlRpcServerConnection DHTXMLRealworldApp XmlRpc::XmlRpcThreadedServer 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]

Return the file descriptor being monitored.

00051 { return _fd; }

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

Specify the file descriptor to monitor.

00053 { _fd = fd; }

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

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

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.

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.

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.


Member Data Documentation

bool XmlRpc::XmlRpcSource::_ssl

SSL_CTX* XmlRpc::XmlRpcSource::_ssl_ctx

SSL* XmlRpc::XmlRpcSource::_ssl_ssl

SSL_METHOD* XmlRpc::XmlRpcSource::_ssl_meth

int XmlRpc::XmlRpcSource::_fd [private]

bool XmlRpc::XmlRpcSource::_deleteOnClose [private]

bool XmlRpc::XmlRpcSource::_keepOpen [private]


The documentation for this class was generated from the following files:
Generated on Tue Jul 24 16:51:19 2007 for ITM OverSim by  doxygen 1.5.1