27 #include <ibrcommon/TimeMeasurement.h>
28 #include <ibrcommon/Logger.h>
30 using namespace dtn::data;
37 : std::iostream(&_buf), _callback(cb), _buf(*this, stream, buffer_size), _shutdown_reason(CONNECTION_SHUTDOWN_NOTSET)
51 header.
_keepalive =
static_cast<uint16_t
>(timeout);
57 _peer = _buf.handshake(header);
83 ibrcommon::MutexLock l(_shutdown_reason_lock);
89 _shutdown_reason = csc;
140 void StreamConnection::eventBundleRefused()
142 IBRCOMMON_LOGGER_DEBUG_TAG(
"StreamConnection", 20) <<
"bundle has been refused" << IBRCOMMON_LOGGER_ENDL;
146 void StreamConnection::eventBundleForwarded()
148 IBRCOMMON_LOGGER_DEBUG_TAG(
"StreamConnection", 20) <<
"bundle has been forwarded" << IBRCOMMON_LOGGER_ENDL;
152 void StreamConnection::connectionTimeout()
160 _buf.enableIdleTimeout(seconds);
virtual void eventShutdown(StreamConnection::ConnectionShutdownCases csc)=0
virtual void eventConnectionUp(const StreamContactHeader &header)=0
virtual ~StreamConnection()
void handshake(const dtn::data::EID &eid, const dtn::data::Timeout &timeout, const dtn::data::Bitset< StreamContactHeader::HEADER_BITS > &flags)
void enableIdleTimeout(const dtn::data::Timeout &seconds)
void shutdown(ConnectionShutdownCases csc=CONNECTION_SHUTDOWN_SIMPLE_SHUTDOWN)
virtual void eventBundleAck(const dtn::data::Length &ack)=0
virtual void eventTimeout()=0
virtual void eventConnectionDown()=0
virtual void eventError()=0
virtual void eventBundleForwarded()=0
virtual void eventBundleRefused()=0