42 #ifndef BLOCXX_SOCKETBASEIMPL_HPP_INCLUDE_GUARD_
43 #define BLOCXX_SOCKETBASEIMPL_HPP_INCLUDE_GUARD_
44 #include "blocxx/BLOCXX_config.h"
55 #if defined(BLOCXX_HAVE_ISTREAM) && defined(BLOCXX_HAVE_OSTREAM)
65 namespace BLOCXX_NAMESPACE
76 virtual void disconnect();
83 void setTimeouts(
const Timeout& timeout) { m_recvTimeout = m_sendTimeout = m_connectTimeout = timeout; }
85 int write(
const void* dataOut,
int dataOutLen,
86 ErrorAction errorAsException = E_RETURN_ON_ERROR);
87 int read(
void* dataIn,
int dataInLen,
88 ErrorAction errorAsException = E_RETURN_ON_ERROR);
89 virtual bool waitForInput(
const Timeout& timeout);
90 bool waitForOutput(
const Timeout& timeout);
91 std::istream& getInputStream();
92 std::ostream& getOutputStream();
93 std::iostream& getIOStream();
99 static void setDumpFiles(
const String& in,
const String& out);
101 virtual int readAux(
void* dataIn,
int dataInLen) = 0;
102 virtual int writeAux(
const void* dataOut,
int dataOutLen) = 0;
108 #if defined(BLOCXX_WIN32)
113 void fillInetAddrParms();
114 #if !defined(BLOCXX_WIN32)
115 void fillUnixAddrParms();
119 #if defined(BLOCXX_WIN32)
120 static int waitForEvent(HANDLE event,
int secsToTimeout=-1);