28 #include <ibrcommon/net/socketstream.h>
29 #include <ibrcommon/thread/Mutex.h>
30 #include <ibrcommon/thread/MutexLock.h>
31 #include <ibrcommon/Exceptions.h>
32 #include <ibrcommon/thread/Queue.h>
44 ConnectionException(
string what =
"A connection error occurred.") throw() : ibrcommon::Exception(what)
90 class AsyncReceiver :
public ibrcommon::JoinableThread
98 AsyncReceiver(
Client &client);
104 virtual ~AsyncReceiver();
118 void __cancellation()
throw ();
246 virtual
void received(const dtn::streams::StreamContactHeader&) {};
257 ibrcommon::socketstream &_stream;
269 Client::AsyncReceiver _receiver;
272 ibrcommon::Queue<dtn::data::Bundle> _inqueue;
void operator<<(const dtn::data::Bundle &b)
StreamConnection(StreamConnection::Callback &cb, iostream &stream, const dtn::data::Length buffer_size=4096)
bidirectional communication is requested
virtual void eventConnectionDown()
virtual void eventBundleForwarded()
Client(const std::string &app, ibrcommon::socketstream &stream, const COMMUNICATION_MODE mode=MODE_BIDIRECTIONAL)
ConnectionAbortedException(string what="Aborted.")
virtual void eventBundleRefused()
virtual void received(const dtn::streams::StreamContactHeader &)
dtn::api::Client * _client
virtual void eventConnectionUp(const dtn::streams::StreamContactHeader &)
dtn::data::Bundle getBundle(const dtn::data::Timeout timeout=0)
ConnectionTimeoutException(string what="Timeout.")
virtual void eventError()
unidirectional communication is requested, no reception of bundles
dtn::data::Length lastack
virtual void eventTimeout()
virtual void eventShutdown(StreamConnection::ConnectionShutdownCases)
ConnectionException(string what="A connection error occurred.")
virtual void eventBundleAck(const dtn::data::Length &ack)