27 #include <ibrcommon/Logger.h>
28 #include <ibrcommon/thread/MutexLock.h>
41 using namespace dtn::data;
48 : _address(address), _sender(_stream), _stream(cl, address), _cl(cl)
87 deserializer >> bundle;
89 IBRCOMMON_LOGGER_DEBUG_TAG(
"LOWPANConnection", 10) <<
"LOWPANConnection::run"<< IBRCOMMON_LOGGER_ENDL;
92 std::stringstream ss; ss <<
"lowpan:" <<
_address.address() <<
"." <<
_address.service();
100 if (ret == BundleFilter::ACCEPT) {
105 IBRCOMMON_LOGGER_DEBUG_TAG(
"LOWPANConnection", 10) <<
"Received a invalid bundle: " << ex.what() << IBRCOMMON_LOGGER_ENDL;
106 }
catch (
const ibrcommon::IOException &ex) {
107 IBRCOMMON_LOGGER_DEBUG_TAG(
"LOWPANConnection", 10) <<
"IOException: " << ex.what() << IBRCOMMON_LOGGER_ENDL;
110 }
catch (std::exception &ex) {
111 IBRCOMMON_LOGGER_DEBUG_TAG(
"LOWPANConnection", 10) <<
"Thread died: " << ex.what() << IBRCOMMON_LOGGER_ENDL;
132 IBRCOMMON_LOGGER_DEBUG_TAG(
"LOWPANConnectionSender", 85) <<
"queue"<< IBRCOMMON_LOGGER_ENDL;
143 while(_stream.good())
148 IBRCOMMON_LOGGER_DEBUG_TAG(
"LOWPANConnectionSender", 85) <<
"run"<< IBRCOMMON_LOGGER_ENDL;
160 if (ret != BundleFilter::ACCEPT) {
166 serializer << bundle; _stream.flush();
173 IBRCOMMON_LOGGER_DEBUG_TAG(
"LOWPANConnectionSender", 45) <<
"stream destroyed"<< IBRCOMMON_LOGGER_ENDL;
174 }
catch (std::exception &ex) {
175 IBRCOMMON_LOGGER_DEBUG_TAG(
"LOWPANConnectionSender", 40) <<
"Thread died: " << ex.what() << IBRCOMMON_LOGGER_ENDL;
virtual ~LOWPANConnectionSender()
const ibrcommon::vaddress _address
void remove(const LOWPANConnection *conn)
void setBundle(const dtn::data::Bundle &data)
BundleFilter::ACTION filter(BundleFilter::TABLE table, const FilterContext &context, dtn::data::Bundle &bundle) const
void setProtocol(const dtn::core::Node::Protocol &protocol)
void setPeer(const dtn::data::EID &endpoint)
const dtn::data::EID & getNeighbor() const
virtual dtn::data::Bundle get(const dtn::data::BundleID &id)=0
dtn::core::Node::Protocol getDiscoveryProtocol() const
void abort(const TransferAbortedEvent::AbortReason reason)
const dtn::data::MetaBundle & getBundle() const
ibrcommon::lowpanstream & getStream()
LOWPANConnectionSender(ibrcommon::lowpanstream &_stream)
dtn::storage::BundleStorage & getStorage()
virtual ~LOWPANConnection()
LOWPANConnectionSender _sender
static void raise(const dtn::data::EID &peer, const dtn::data::Bundle &bundle, const bool local=false)
static BundleCore & getInstance()
void queue(const dtn::net::BundleTransfer &job)