IBR-DTNSuite
0.8
|
#include <BinaryStreamClient.h>
Classes | |
class | Sender |
Public Member Functions | |
BinaryStreamClient (ClientHandler &client, ibrcommon::tcpstream &stream) | |
virtual | ~BinaryStreamClient () |
virtual void | eventShutdown (dtn::streams::StreamConnection::ConnectionShutdownCases csc) |
virtual void | eventTimeout () |
virtual void | eventError () |
virtual void | eventConnectionDown () |
virtual void | eventConnectionUp (const dtn::streams::StreamContactHeader &header) |
virtual void | eventBundleRefused () |
virtual void | eventBundleForwarded () |
virtual void | eventBundleAck (size_t ack) |
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 () |
bool | good () const |
Friends | |
class | Sender |
Definition at line 19 of file BinaryStreamClient.h.
dtn::api::BinaryStreamClient::BinaryStreamClient | ( | ClientHandler & | client, |
ibrcommon::tcpstream & | stream | ||
) |
Definition at line 24 of file BinaryStreamClient.cpp.
dtn::api::BinaryStreamClient::~BinaryStreamClient | ( | ) | [virtual] |
Definition at line 29 of file BinaryStreamClient.cpp.
References dtn::api::ProtocolHandler::_client, dtn::api::Registration::abort(), and dtn::api::ClientHandler::getRegistration().
void dtn::api::BinaryStreamClient::__cancellation | ( | ) | [virtual] |
Implements dtn::api::ProtocolHandler.
Definition at line 119 of file BinaryStreamClient.cpp.
References dtn::api::ProtocolHandler::_stream, ibrcommon::tcpstream::close(), dtn::streams::StreamConnection::CONNECTION_SHUTDOWN_ERROR, and dtn::streams::StreamConnection::shutdown().
void dtn::api::BinaryStreamClient::eventBundleAck | ( | size_t | ack | ) | [virtual] |
This method is called if a ACK is received.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 114 of file BinaryStreamClient.cpp.
void dtn::api::BinaryStreamClient::eventBundleForwarded | ( | ) | [virtual] |
This method is called if a bundle is refused by the peer.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 99 of file BinaryStreamClient.cpp.
References dtn::api::ProtocolHandler::_client, dtn::api::Registration::delivered(), ibrcommon::Queue< T >::getnpop(), and dtn::api::ClientHandler::getRegistration().
void dtn::api::BinaryStreamClient::eventBundleRefused | ( | ) | [virtual] |
This method is called if a bundle is refused by the peer.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 86 of file BinaryStreamClient.cpp.
References ibrcommon::Queue< T >::getnpop().
void dtn::api::BinaryStreamClient::eventConnectionDown | ( | ) | [virtual] |
This method is called if a connection went down.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 72 of file BinaryStreamClient.cpp.
References dtn::api::ProtocolHandler::_client, dtn::api::ClientHandler::getRegistration(), IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, dtn::api::Registration::unsubscribe(), and ibrcommon::Exception::what().
void dtn::api::BinaryStreamClient::eventConnectionUp | ( | const dtn::streams::StreamContactHeader & | header | ) | [virtual] |
This method is called if a handshake was successful.
header |
Implements dtn::streams::StreamConnection::Callback.
Definition at line 52 of file BinaryStreamClient.cpp.
References dtn::api::ProtocolHandler::_client, dtn::streams::StreamContactHeader::_localeid, dtn::api::Registration::getDefaultEID(), dtn::data::EID::getDelimiter(), dtn::api::Registration::getHandle(), dtn::api::ClientHandler::getRegistration(), dtn::data::EID::getSSP(), dtn::data::EID::getString(), IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, dtn::data::EID::isNone(), and dtn::api::Registration::subscribe().
void dtn::api::BinaryStreamClient::eventError | ( | ) | [virtual] |
This method is called if a error occured in the stream.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 48 of file BinaryStreamClient.cpp.
void dtn::api::BinaryStreamClient::eventShutdown | ( | dtn::streams::StreamConnection::ConnectionShutdownCases | csc | ) | [virtual] |
This method is called if a SHUTDOWN message is received.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 40 of file BinaryStreamClient.cpp.
void dtn::api::BinaryStreamClient::eventTimeout | ( | ) | [virtual] |
This method is called if the stream is closed by a TIMEOUT.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 44 of file BinaryStreamClient.cpp.
void dtn::api::BinaryStreamClient::finally | ( | void | ) | [virtual] |
Implements dtn::api::ProtocolHandler.
Definition at line 130 of file BinaryStreamClient.cpp.
References dtn::api::ProtocolHandler::_client, dtn::api::ProtocolHandler::_stream, dtn::api::Registration::abort(), ibrcommon::tcpstream::close(), dtn::api::ClientHandler::getRegistration(), IBRCOMMON_LOGGER_DEBUG, and IBRCOMMON_LOGGER_ENDL.
const dtn::data::EID & dtn::api::BinaryStreamClient::getPeer | ( | ) | const |
Definition at line 35 of file BinaryStreamClient.cpp.
bool dtn::api::BinaryStreamClient::good | ( | ) | const |
Definition at line 191 of file BinaryStreamClient.cpp.
References dtn::api::ProtocolHandler::_stream.
void dtn::api::BinaryStreamClient::queue | ( | const dtn::data::Bundle & | bundle | ) |
Definition at line 255 of file BinaryStreamClient.cpp.
void dtn::api::BinaryStreamClient::received | ( | const dtn::streams::StreamContactHeader & | h | ) |
void dtn::api::BinaryStreamClient::run | ( | void | ) | [virtual] |
Implements dtn::api::ProtocolHandler.
Definition at line 148 of file BinaryStreamClient.cpp.
References dtn::api::ProtocolHandler::_client, dtn::streams::StreamConnection::CONNECTION_SHUTDOWN_ERROR, dtn::api::ClientHandler::getAPIServer(), dtn::streams::StreamConnection::handshake(), IBRCOMMON_LOGGER, IBRCOMMON_LOGGER_DEBUG, IBRCOMMON_LOGGER_ENDL, dtn::core::BundleCore::local, dtn::api::ApiServerInterface::processIncomingBundle(), dtn::data::PrimaryBlock::relabel(), dtn::streams::StreamContactHeader::REQUEST_ACKNOWLEDGMENTS, dtn::streams::StreamConnection::shutdown(), and ibrcommon::Exception::what().
friend class Sender [friend] |
Definition at line 63 of file BinaryStreamClient.h.