45 : _receiver(*this), _session_cb(session_cb), _serializer_cb(serializer_cb)
62 _serializer_cb = NULL;
73 _registration.
abort();
84 if (_session_cb == NULL)
return;
85 _session_cb->notifyBundle(
id);
91 if (_session_cb == NULL)
return;
92 _session_cb->notifyStatusReport(source, report);
98 if (_session_cb == NULL)
return;
99 _session_cb->notifyCustodySignal(source, custody);
114 _registration.unsubscribe(_endpoint);
115 _registration.subscribe(new_endpoint);
116 _endpoint = new_endpoint;
142 _registration.subscribe(new_endpoint);
159 _registration.unsubscribe(old_endpoint);
174 _registration.subscribe(eid);
189 _registration.unsubscribe(eid);
200 for (std::set<dtn::data::EID>::const_iterator it = subs.begin(); it != subs.end(); ++it) {
202 if (e != _endpoint) {
213 std::vector<std::string> ret;
214 for (std::set<dtn::data::EID>::const_iterator it = subs.begin(); it != subs.end(); ++it) {
215 ret.push_back((*it).getString());
253 if (_serializer_cb == NULL)
return;
257 serializer << _bundle[ri];
266 if (_serializer_cb == NULL)
return;
270 serializer << _bundle[ri];
296 _registration.delivered(meta);
307 _bundle[ri].relabel();
340 std::streamsize stream_size = stream.
size();
342 if ((offset > 0) || (stream_size < static_cast<std::streamsize>(offset))) {
343 (*stream).seekp(0, std::ios_base::end);
345 (*stream).seekp(offset);
348 (*stream).write(buf, len);
349 (*stream) << std::flush;
356 std::streamsize stream_size = stream.
size();
358 if ((offset > 0) || (stream_size < static_cast<std::streamsize>(offset))) {
359 (*stream).seekp(0, std::ios_base::end);
361 (*stream).seekp(offset);
363 (*stream).write(buf, len);
364 (*stream) << std::flush;
378 (*stream).seekg(offset);
379 (*stream).read(buf, len);
381 len = (*stream).gcount();
388 NativeSession::BundleReceiver::BundleReceiver(
NativeSession &session)
393 NativeSession::BundleReceiver::~BundleReceiver()
397 void NativeSession::BundleReceiver::raiseEvent(
const dtn::core::Event *evt)
throw ()
409 }
catch (
const std::bad_cast&) { };
421 fireNotificationAdministrativeRecord(
id);
429 _bundle_queue.
push(
id);
432 fireNotificationBundle(
id);
439 throw NativeSessionException(std::string(
"loop aborted - ") + ex.
what());
440 }
catch (
const std::exception &ex) {
441 throw NativeSessionException(std::string(
"loop aborted - ") + ex.what());
456 report.
read(payload);
461 fireNotificationStatusReport(b.
source, report);
469 custody.
read(payload);
474 fireNotificationCustodySignal(b.
source, custody);