forked from spillz/codeblocks-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXmlRpcSource.cpp
More file actions
35 lines (27 loc) · 724 Bytes
/
Copy pathXmlRpcSource.cpp
File metadata and controls
35 lines (27 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "XmlRpcSource.h"
#include "XmlRpcSocket.h"
#include "XmlRpcUtil.h"
namespace XmlRpc {
XmlRpcSource::XmlRpcSource(int fd /*= -1*/, bool deleteOnClose /*= false*/)
: _fd(fd), _deleteOnClose(deleteOnClose), _keepOpen(false)
{
}
XmlRpcSource::~XmlRpcSource()
{
}
void
XmlRpcSource::close()
{
if (_fd != -1) {
XmlRpcUtil::log(2,"XmlRpcSource::close: closing socket %d.", _fd);
XmlRpcSocket::close(_fd);
XmlRpcUtil::log(2,"XmlRpcSource::close: done closing socket %d.", _fd);
_fd = -1;
}
if (_deleteOnClose) {
XmlRpcUtil::log(2,"XmlRpcSource::close: deleting this");
_deleteOnClose = false;
delete this;
}
}
} // namespace XmlRpc