# # patch "netsync.cc" # from [86f65c036a069e221fdd8b4865f2564ac6267fd6] # to [d4e8d11b8e507478de9b3a1b658f36b106c14b60] # # patch "netxx_pipe.cc" # from [b4898ef8c28d02bd140a563ec2611f1330a40334] # to [e6afd932de85b93ed48ad092f24abbc295ace854] # # patch "netxx_pipe.hh" # from [58043f96e71692d0db022a0b8318211c079f6e53] # to [da5c07b8728ee74c0d91457d0bdafe9fd54dbd02] # ======================================================================== --- netsync.cc 86f65c036a069e221fdd8b4865f2564ac6267fd6 +++ netsync.cc d4e8d11b8e507478de9b3a1b658f36b106c14b60 @@ -3448,7 +3448,7 @@ } static void -arm_sessions_and_calculate_probe(Netxx::Probe & probe, +arm_sessions_and_calculate_probe(Netxx::PipeCompatibleProbe & probe, map > & sessions, set & armed_sessions) { @@ -3626,7 +3626,7 @@ unsigned long timeout_seconds, unsigned long session_limit) { - Netxx::Probe probe; + Netxx::PipeCompatibleProbe probe; Netxx::Timeout forever, ======================================================================== --- netxx_pipe.cc b4898ef8c28d02bd140a563ec2611f1330a40334 +++ netxx_pipe.cc e6afd932de85b93ed48ad092f24abbc295ace854 @@ -57,6 +57,7 @@ #include #include #include +#include #endif Netxx::PipeStream::PipeStream (const std::string &cmd, const std::vector &args) @@ -146,7 +147,7 @@ #else return ::read(readfd,buffer,length); #endif -} + } Netxx::signed_size_type Netxx::PipeStream::write(const void *buffer, size_type length) { return ::write(writefd,buffer,length); @@ -237,14 +238,22 @@ } void Netxx::PipeCompatibleProbe::add(const StreamBase &sb, ready_type rt) -{ try +{ // L(F("PCP::add()\n")); + try { add(const_cast(dynamic_cast(sb)),rt); + // L(F("... was a pipe\n")); } catch (...) { assert(!is_pipe); Probe::add(sb,rt); + // L(F("... was a socket\n")); } } + +void Netxx::PipeCompatibleProbe::add(const StreamServer &ss, ready_type rt) +{ assert(!ip_pipe); + Probe::add(ss,rt); +} #endif #ifdef BUILD_UNIT_TESTS ======================================================================== --- netxx_pipe.hh 58043f96e71692d0db022a0b8318211c079f6e53 +++ netxx_pipe.hh da5c07b8728ee74c0d91457d0bdafe9fd54dbd02 @@ -36,6 +36,7 @@ namespace Netxx { #ifdef WIN32 class PipeCompatibleProbe; +class StreamServer; #endif class PipeStream : public StreamBase @@ -76,6 +77,7 @@ result_type ready(const Timeout &timeout=Timeout(), ready_type rt=ready_none); void add(PipeStream &ps, ready_type rt=ready_none); void add(const StreamBase &sb, ready_type rt=ready_none); + void add(const StreamServer &ss, ready_type rt=ready_none); void remove(const PipeStream &ps); #if 0 // should be covered by StreamBase template void add (const T &t, ready_type rt=ready_none)