IBR-DTNSuite
0.12
|
#include <BinaryStreamClient.h>
Public Member Functions | |
BinaryStreamClient (ClientHandler &client, ibrcommon::socketstream &stream) | |
virtual | ~BinaryStreamClient () |
virtual void | eventShutdown (dtn::streams::StreamConnection::ConnectionShutdownCases csc) throw () |
virtual void | eventTimeout () throw () |
virtual void | eventError () throw () |
virtual void | eventConnectionDown () throw () |
virtual void | eventConnectionUp (const dtn::streams::StreamContactHeader &header) throw () |
virtual void | eventBundleRefused () throw () |
virtual void | eventBundleForwarded () throw () |
virtual void | eventBundleAck (const dtn::data::Length &ack) throw () |
const dtn::data::EID & | getPeer () const |
void | queue (const dtn::data::Bundle &bundle) |
void | received (const dtn::streams::StreamContactHeader &h) |
void | run () |
void | finally () |
void | __cancellation () throw () |
bool | good () const |
Public Member Functions inherited from dtn::streams::StreamConnection::Callback | |
virtual void | addTrafficIn (size_t) throw () |
virtual void | addTrafficOut (size_t) throw () |
Public Member Functions inherited from dtn::api::ProtocolHandler | |
virtual | ~ProtocolHandler ()=0 |
virtual void | setup () |
Friends | |
class | Sender |
Additional Inherited Members | |
Protected Member Functions inherited from dtn::api::ProtocolHandler | |
ProtocolHandler (ClientHandler &client, ibrcommon::socketstream &stream) | |
Protected Attributes inherited from dtn::api::ProtocolHandler | |
ClientHandler & | _client |
ibrcommon::socketstream & | _stream |
Definition at line 33 of file BinaryStreamClient.h.
dtn::api::BinaryStreamClient::BinaryStreamClient | ( | ClientHandler & | client, |
ibrcommon::socketstream & | stream | ||
) |
Definition at line 37 of file BinaryStreamClient.cpp.
|
virtual |
Definition at line 42 of file BinaryStreamClient.cpp.
References dtn::api::ProtocolHandler::_client, dtn::api::Registration::abort(), and dtn::api::ClientHandler::getRegistration().
|
virtual |
Implements dtn::api::ProtocolHandler.
Definition at line 134 of file BinaryStreamClient.cpp.
References dtn::api::ProtocolHandler::_stream, ibrcommon::socketstream::close(), dtn::streams::StreamConnection::CONNECTION_SHUTDOWN_ERROR, and dtn::streams::StreamConnection::shutdown().
|
virtual |
This method is called if a ACK is received.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 129 of file BinaryStreamClient.cpp.
|
virtual |
This method is called if a bundle is refused by the peer.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 113 of file BinaryStreamClient.cpp.
References dtn::api::ProtocolHandler::_client, dtn::data::MetaBundle::create(), dtn::api::Registration::delivered(), ibrcommon::Queue< T >::getnpop(), and dtn::api::ClientHandler::getRegistration().
|
virtual |
This method is called if a bundle is refused by the peer.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 100 of file BinaryStreamClient.cpp.
References ibrcommon::Queue< T >::getnpop().
|
virtual |
This method is called if a connection went down.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 86 of file BinaryStreamClient.cpp.
References dtn::api::ProtocolHandler::_client, ibrcommon::LogLevel::error, dtn::api::ClientHandler::getRegistration(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, dtn::api::Registration::unsubscribe(), and ibrcommon::Exception::what().
|
virtual |
This method is called if a handshake was successful.
header |
Implements dtn::streams::StreamConnection::Callback.
Definition at line 65 of file BinaryStreamClient.cpp.
References _client, dtn::api::Registration::getDefaultEID(), dtn::api::Registration::getHandle(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, dtn::data::EID::setApplication(), and dtn::api::Registration::subscribe().
|
virtual |
This method is called if a error occured in the stream.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 61 of file BinaryStreamClient.cpp.
|
virtual |
This method is called if a SHUTDOWN message is received.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 53 of file BinaryStreamClient.cpp.
|
virtual |
This method is called if the stream is closed by a TIMEOUT.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 57 of file BinaryStreamClient.cpp.
|
virtual |
Implements dtn::api::ProtocolHandler.
Definition at line 143 of file BinaryStreamClient.cpp.
References dtn::api::ProtocolHandler::_client, dtn::api::ProtocolHandler::_stream, dtn::api::Registration::abort(), ibrcommon::socketstream::close(), dtn::api::ClientHandler::getRegistration(), IBRCOMMON_LOGGER_DEBUG_TAG, and IBRCOMMON_LOGGER_ENDL.
const dtn::data::EID & dtn::api::BinaryStreamClient::getPeer | ( | ) | const |
Definition at line 48 of file BinaryStreamClient.cpp.
bool dtn::api::BinaryStreamClient::good | ( | ) | const |
Definition at line 199 of file BinaryStreamClient.cpp.
References dtn::api::ProtocolHandler::_stream.
void dtn::api::BinaryStreamClient::queue | ( | const dtn::data::Bundle & | bundle) |
Definition at line 263 of file BinaryStreamClient.cpp.
void dtn::api::BinaryStreamClient::received | ( | const dtn::streams::StreamContactHeader & | h) |
|
virtual |
Implements dtn::api::ProtocolHandler.
Definition at line 159 of file BinaryStreamClient.cpp.
References dtn::streams::StreamConnection::CONNECTION_SHUTDOWN_ERROR, ibrcommon::LogLevel::error, dtn::streams::StreamConnection::handshake(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, dtn::core::BundleCore::local, dtn::api::Registration::processIncomingBundle(), dtn::streams::StreamContactHeader::REQUEST_ACKNOWLEDGMENTS, dtn::streams::StreamConnection::shutdown(), and ibrcommon::Exception::what().
|
friend |
Definition at line 77 of file BinaryStreamClient.h.