#include <ClientHandler.h>
Public Member Functions | |
| ClientHandler (ibrcommon::tcpstream *stream) | |
| virtual | ~ClientHandler () |
| void | iamfree () |
| bool | free () |
| bool | isConnected () |
| virtual void | shutdown () |
| virtual void | eventShutdown () |
| virtual void | eventTimeout () |
| virtual void | eventError () |
| virtual void | eventConnectionDown () |
| virtual void | eventConnectionUp (const StreamContactHeader &header) |
| virtual void | eventBundleRefused () |
| virtual void | eventBundleForwarded () |
| virtual void | eventBundleAck (size_t ack) |
| const dtn::data::EID & | getPeer () const |
Protected Member Functions | |
| void | received (const dtn::streams::StreamContactHeader &h) |
| void | run () |
Friends | |
| ClientHandler & | operator>> (ClientHandler &conn, dtn::data::Bundle &bundle) |
| ClientHandler & | operator<< (ClientHandler &conn, const dtn::data::Bundle &bundle) |
Definition at line 25 of file ClientHandler.h.
| dtn::daemon::ClientHandler::ClientHandler | ( | ibrcommon::tcpstream * | stream | ) |
Definition at line 25 of file ClientHandler.cpp.
| dtn::daemon::ClientHandler::~ClientHandler | ( | ) | [virtual] |
Definition at line 30 of file ClientHandler.cpp.
References ibrcommon::JoinableThread::join(), and shutdown().
| void dtn::daemon::ClientHandler::eventBundleAck | ( | size_t | ack | ) | [virtual] |
This method is called if a ACK is received.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 144 of file ClientHandler.cpp.
| void dtn::daemon::ClientHandler::eventBundleForwarded | ( | ) | [virtual] |
This method is called if a bundle is refused by the peer.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 128 of file ClientHandler.cpp.
References dtn::core::BUNDLE_DELIVERED, ibrcommon::ThreadSafeQueue< T >::frontpop(), and dtn::core::BundleEvent::raise().
| void dtn::daemon::ClientHandler::eventBundleRefused | ( | ) | [virtual] |
This method is called if a bundle is refused by the peer.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 115 of file ClientHandler.cpp.
References ibrcommon::ThreadSafeQueue< T >::frontpop().
| void dtn::daemon::ClientHandler::eventConnectionDown | ( | ) | [virtual] |
This method is called if a connection went down.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 85 of file ClientHandler.cpp.
References ibrcommon::ThreadSafeQueue< T >::frontpop(), and iamfree().
| void dtn::daemon::ClientHandler::eventConnectionUp | ( | const StreamContactHeader & | header | ) | [virtual] |
This method is called if a handshake was successful.
| header |
Implements dtn::streams::StreamConnection::Callback.
Definition at line 65 of file ClientHandler.cpp.
References dtn::streams::StreamContactHeader::_localeid, dtn::data::EID::CBHE_SCHEME, dtn::data::EID::getNode(), and dtn::core::BundleCore::local.
| void dtn::daemon::ClientHandler::eventError | ( | ) | [virtual] |
This method is called if a error occured in the stream.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 80 of file ClientHandler.cpp.
| void dtn::daemon::ClientHandler::eventShutdown | ( | ) | [virtual] |
This method is called if a SHUTDOWN message is received.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 52 of file ClientHandler.cpp.
| void dtn::daemon::ClientHandler::eventTimeout | ( | ) | [virtual] |
This method is called if the stream is closed by a TIMEOUT.
Implements dtn::streams::StreamConnection::Callback.
Definition at line 59 of file ClientHandler.cpp.
| bool dtn::daemon::ClientHandler::free | ( | ) | [virtual] |
Implements dtn::net::GenericConnection.
Definition at line 46 of file ClientHandler.cpp.
| const dtn::data::EID & dtn::daemon::ClientHandler::getPeer | ( | ) | const |
Definition at line 36 of file ClientHandler.cpp.
Referenced by run().
| void dtn::daemon::ClientHandler::iamfree | ( | ) |
Definition at line 41 of file ClientHandler.cpp.
Referenced by eventConnectionDown().
| bool dtn::daemon::ClientHandler::isConnected | ( | ) |
Definition at line 149 of file ClientHandler.cpp.
References dtn::streams::StreamConnection::isConnected().
| void dtn::daemon::ClientHandler::received | ( | const dtn::streams::StreamContactHeader & | h | ) | [protected] |
| void dtn::daemon::ClientHandler::run | ( | ) | [protected, virtual] |
Abstract interface for thread context run method.
Implements ibrcommon::Thread.
Definition at line 167 of file ClientHandler.cpp.
References dtn::data::PrimaryBlock::_custodian, dtn::data::PrimaryBlock::_destination, dtn::data::PrimaryBlock::_reportto, dtn::data::PrimaryBlock::_source, dtn::core::BundleStorage::get(), dtn::core::BundleCore::getInstance(), getPeer(), dtn::core::BundleCore::getStorage(), dtn::streams::StreamConnection::handshake(), dtn::core::BundleCore::local, dtn::net::BundleReceivedEvent::raise(), dtn::data::PrimaryBlock::relabel(), dtn::core::BundleStorage::remove(), dtn::streams::StreamContactHeader::REQUEST_ACKNOWLEDGMENTS, dtn::streams::StreamConnection::shutdown(), and ibrcommon::Thread::yield().
| void dtn::daemon::ClientHandler::shutdown | ( | ) | [virtual] |
Implements dtn::net::GenericConnection.
Definition at line 154 of file ClientHandler.cpp.
References dtn::streams::StreamConnection::shutdown(), and dtn::streams::StreamConnection::wait().
Referenced by ~ClientHandler().
| ClientHandler& operator<< | ( | ClientHandler & | conn, | |
| const dtn::data::Bundle & | bundle | |||
| ) | [friend] |
Definition at line 237 of file ClientHandler.cpp.
| ClientHandler& operator>> | ( | ClientHandler & | conn, | |
| dtn::data::Bundle & | bundle | |||
| ) | [friend] |
Definition at line 229 of file ClientHandler.cpp.
1.6.3