|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef SERVER_PSTREAM_HPP_INCLUDED |
|
|
#define SERVER_PSTREAM_HPP_INCLUDED |
|
|
|
|
|
#ifdef _WIN32 |
|
|
|
|
|
# include <winsock2.h> |
|
|
# include <ws2tcpip.h> |
|
|
#else |
|
|
#include <sys/socket.h> |
|
|
#endif |
|
|
|
|
|
#include <xmlrpc-c/config.h> |
|
|
#include <xmlrpc-c/c_util.h> |
|
|
#include <xmlrpc-c/registry.hpp> |
|
|
#include <xmlrpc-c/packetsocket.hpp> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef XMLRPC_BUILDING_SERVER_PSTREAMPP |
|
|
#define XMLRPC_SERVER_PSTREAMPP_EXPORTED XMLRPC_DLLEXPORT |
|
|
#else |
|
|
#define XMLRPC_SERVER_PSTREAMPP_EXPORTED |
|
|
#endif |
|
|
|
|
|
namespace xmlrpc_c { |
|
|
|
|
|
class XMLRPC_SERVER_PSTREAMPP_EXPORTED serverPstreamConn { |
|
|
|
|
|
public: |
|
|
|
|
|
struct constrOpt_impl; |
|
|
|
|
|
class XMLRPC_SERVER_PSTREAMPP_EXPORTED constrOpt { |
|
|
public: |
|
|
constrOpt(); |
|
|
~constrOpt(); |
|
|
|
|
|
constrOpt & registryPtr (xmlrpc_c::registryPtr const& arg); |
|
|
constrOpt & registryP (const xmlrpc_c::registry * const& arg); |
|
|
constrOpt & socketFd (XMLRPC_SOCKET const& arg); |
|
|
|
|
|
private: |
|
|
struct constrOpt_impl * implP; |
|
|
friend class serverPstreamConn; |
|
|
}; |
|
|
|
|
|
serverPstreamConn(constrOpt const& opt); |
|
|
|
|
|
~serverPstreamConn(); |
|
|
|
|
|
void |
|
|
runOnce(xmlrpc_c::callInfo * const callInfoP, |
|
|
volatile const int * const interruptP, |
|
|
bool * const eofP); |
|
|
|
|
|
void |
|
|
runOnce(volatile const int * const interruptP, |
|
|
bool * const eofP); |
|
|
|
|
|
void |
|
|
runOnce(bool * const eofP); |
|
|
|
|
|
void |
|
|
runOnceNoWait(callInfo * const callInfoP, |
|
|
bool * const eofP, |
|
|
bool * const didOneP); |
|
|
|
|
|
void |
|
|
runOnceNoWait(bool * const eofP, |
|
|
bool * const didOneP); |
|
|
|
|
|
void |
|
|
runOnceNoWait(bool * const eofP); |
|
|
|
|
|
void |
|
|
run(xmlrpc_c::callInfo * const callInfoP, |
|
|
volatile const int * const interruptP); |
|
|
|
|
|
void |
|
|
run(volatile const int * const interruptP); |
|
|
|
|
|
void |
|
|
run(); |
|
|
|
|
|
private: |
|
|
struct serverPstreamConn_impl * implP; |
|
|
}; |
|
|
|
|
|
|
|
|
class XMLRPC_SERVER_PSTREAMPP_EXPORTED serverPstream { |
|
|
|
|
|
public: |
|
|
|
|
|
struct constrOpt_impl; |
|
|
|
|
|
class XMLRPC_SERVER_PSTREAMPP_EXPORTED constrOpt { |
|
|
public: |
|
|
constrOpt(); |
|
|
~constrOpt(); |
|
|
|
|
|
constrOpt & registryPtr (xmlrpc_c::registryPtr const& arg); |
|
|
constrOpt & registryP (const xmlrpc_c::registry * const& arg); |
|
|
constrOpt & socketFd (XMLRPC_SOCKET const& arg); |
|
|
|
|
|
private: |
|
|
struct constrOpt_impl * implP; |
|
|
friend class serverPstream; |
|
|
}; |
|
|
|
|
|
serverPstream(constrOpt const& opt); |
|
|
|
|
|
virtual ~serverPstream(); |
|
|
|
|
|
void |
|
|
runSerial(volatile const int * const interruptP); |
|
|
|
|
|
void |
|
|
runSerial(); |
|
|
|
|
|
void |
|
|
terminate(); |
|
|
|
|
|
class shutdown : public xmlrpc_c::registry::shutdown { |
|
|
public: |
|
|
shutdown(xmlrpc_c::serverPstream * const severAbyssP); |
|
|
virtual ~shutdown(); |
|
|
void doit(std::string const& comment, void * const callInfo) const; |
|
|
private: |
|
|
xmlrpc_c::serverPstream * const serverPstreamP; |
|
|
}; |
|
|
|
|
|
private: |
|
|
struct serverPstream_impl * implP; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class XMLRPC_SERVER_PSTREAMPP_EXPORTED callInfo_serverPstream : |
|
|
public xmlrpc_c::callInfo { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
callInfo_serverPstream( |
|
|
xmlrpc_c::serverPstream * const serverP, |
|
|
struct sockaddr const clientAddr, |
|
|
socklen_t const clientAddrSize); |
|
|
|
|
|
xmlrpc_c::serverPstream * const serverP; |
|
|
|
|
|
struct sockaddr const clientAddr; |
|
|
|
|
|
|
|
|
socklen_t const clientAddrSize; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
#endif |
|
|
|