IBR-DTNSuite
0.10
|
#include <DatagramConnection.h>
Public Member Functions | |
DatagramConnection (const std::string &identifier, const DatagramService::Parameter ¶ms, DatagramConnectionCallback &callback) | |
virtual | ~DatagramConnection () |
void | run () throw () |
void | setup () throw () |
void | finally () throw () |
virtual void | __cancellation () throw () |
void | shutdown () |
const std::string & | getIdentifier () const |
void | queue (const dtn::net::BundleTransfer &job) |
void | queue (const char &flags, const unsigned int &seqno, const char *buf, const dtn::data::Length &len) |
void | ack (const unsigned int &seqno) |
void | setPeerEID (const dtn::data::EID &peer) |
Public Member Functions inherited from ibrcommon::DetachedThread | |
virtual | ~DetachedThread ()=0 |
void | start (int priority=0) throw (ThreadException) |
void | stop () throw (ThreadException) |
Static Public Attributes | |
static const std::string | TAG = "DatagramConnection" |
Additional Inherited Members | |
Protected Member Functions inherited from ibrcommon::DetachedThread | |
DetachedThread (size_t size=DEFAULT_STACKSIZE) | |
Static Protected Member Functions inherited from ibrcommon::Thread | |
static size_t | getNumberOfProcessors () |
static void | yield (void) |
static void | sleep (time_t timeout) |
static void | concurrency (int level) |
static bool | equal (pthread_t thread1, pthread_t thread2) |
static void * | __execute__ (void *obj) throw () |
Definition at line 52 of file DatagramConnection.h.
dtn::net::DatagramConnection::DatagramConnection | ( | const std::string & | identifier, |
const DatagramService::Parameter & | params, | ||
DatagramConnectionCallback & | callback | ||
) |
Definition at line 46 of file DatagramConnection.cpp.
|
virtual |
Definition at line 52 of file DatagramConnection.cpp.
|
virtual |
Implements ibrcommon::Thread.
Definition at line 67 of file DatagramConnection.cpp.
Referenced by shutdown().
void dtn::net::DatagramConnection::ack | ( | const unsigned int & | seqno | ) |
This method is called by the DatagramCL, if an ACK is received.
seq |
Definition at line 333 of file DatagramConnection.cpp.
References IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, ibrcommon::Conditional::signal(), and TAG.
Referenced by dtn::net::DatagramConvergenceLayer::componentRun().
|
virtual |
This method is called when the run() method finishes.
Reimplemented from ibrcommon::Thread.
Definition at line 108 of file DatagramConnection.cpp.
References ibrcommon::Conditional::abort(), dtn::net::DatagramConnectionCallback::connectionDown(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, and TAG.
const std::string & dtn::net::DatagramConnection::getIdentifier | ( | ) | const |
Definition at line 131 of file DatagramConnection.cpp.
Referenced by dtn::net::DatagramConvergenceLayer::connectionDown(), dtn::net::DatagramConvergenceLayer::connectionUp(), and queue().
void dtn::net::DatagramConnection::queue | ( | const dtn::net::BundleTransfer & | job | ) |
Queue job for delivery to another node
job |
Definition at line 140 of file DatagramConnection.cpp.
References dtn::net::BundleTransfer::getBundle(), dtn::net::BundleTransfer::getNeighbor(), dtn::data::EID::getString(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, TAG, and dtn::data::BundleID::toString().
Referenced by dtn::net::DatagramConvergenceLayer::componentRun(), and dtn::net::DatagramConvergenceLayer::queue().
void dtn::net::DatagramConnection::queue | ( | const char & | flags, |
const unsigned int & | seqno, | ||
const char * | buf, | ||
const dtn::data::Length & | len | ||
) |
queue data for delivery to the stream
buf | |
len |
Definition at line 151 of file DatagramConnection.cpp.
References dtn::net::DatagramConnectionCallback::callback_ack(), dtn::net::WrongSeqNoException::expected_seqno, dtn::net::DatagramService::FLOW_STOPNWAIT, dtn::net::DatagramService::Parameter::flowcontrol, getIdentifier(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, dtn::net::DatagramService::Parameter::max_seq_numbers, dtn::net::DatagramService::SEGMENT_FIRST, dtn::net::DatagramService::SEGMENT_LAST, dtn::net::DatagramService::Parameter::seq_check, and TAG.
|
virtual |
Abstract interface for thread context run method.
Implements ibrcommon::Thread.
Definition at line 75 of file DatagramConnection.cpp.
References dtn::core::BundleCore::getInstance(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, dtn::net::BundleReceivedEvent::raise(), TAG, and ibrcommon::Exception::what().
void dtn::net::DatagramConnection::setPeerEID | ( | const dtn::data::EID & | peer | ) |
Assign a peer EID to this connection
peer | The EID of this peer. |
Definition at line 342 of file DatagramConnection.cpp.
Referenced by dtn::net::DatagramConvergenceLayer::componentRun().
|
virtual |
This method is called before the run.
Reimplemented from ibrcommon::Thread.
Definition at line 100 of file DatagramConnection.cpp.
References dtn::net::DatagramConnectionCallback::connectionUp(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, and TAG.
void dtn::net::DatagramConnection::shutdown | ( | ) |
Definition at line 59 of file DatagramConnection.cpp.
References __cancellation(), IBRCOMMON_LOGGER_DEBUG_TAG, IBRCOMMON_LOGGER_ENDL, and TAG.
Referenced by dtn::net::DatagramConvergenceLayer::componentRun().
|
static |
Definition at line 55 of file DatagramConnection.h.
Referenced by ack(), finally(), queue(), run(), setup(), and shutdown().