#include <XmlRpcSource.h>
Inheritance diagram for XmlRpc::XmlRpcSource:
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 |
XmlRpc::XmlRpcSource::XmlRpcSource | ( | int | fd = -1 , |
|
bool | deleteOnClose = false | |||
) |
Constructor.
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 }
int XmlRpc::XmlRpcSource::getfd | ( | ) | const [inline] |
void XmlRpc::XmlRpcSource::setfd | ( | int | fd | ) | [inline] |
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.
SSL_CTX* XmlRpc::XmlRpcSource::_ssl_ctx |
SSL_METHOD* XmlRpc::XmlRpcSource::_ssl_meth |
int XmlRpc::XmlRpcSource::_fd [private] |
bool XmlRpc::XmlRpcSource::_deleteOnClose [private] |
bool XmlRpc::XmlRpcSource::_keepOpen [private] |