Skip to content

Commit

Permalink
Merge pull request #63 from sonndinh/read-keyonly
Browse files Browse the repository at this point in the history
Call Javascript callback with control samples
  • Loading branch information
jrw972 authored May 6, 2024
2 parents d33d51b + 4dc5d06 commit 2195e41
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/NodeDRListener.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "NodeDRListener.h"

#include <dds/DCPS/Sample.h>

#include <nan.h>
#include <stdexcept>

Expand Down Expand Up @@ -124,15 +126,11 @@ void NodeDRListener::push_back(const DDS::SampleInfo& src, const void* sample)
return;
}

// TODO: When OpenDDS's vwrite works with key-only samples, e.g. from a dispose or
// unregister_instance call on the writer, this can be removed so that those samples
// can be delivered to the Javascript side.
if (!src.valid_data) {
return;
}
const OpenDDS::DCPS::Sample::Extent ext =
src.valid_data ? OpenDDS::DCPS::Sample::Full : OpenDDS::DCPS::Sample::KeyOnly;

if (vd_) {
if (!vd_->write(nvw_, sample)) {
if (!vd_->write(nvw_, sample, ext)) {
ACE_ERROR((LM_WARNING, "WARNING: ValueDispatcher write failed\n"));
return;
}
Expand Down

0 comments on commit 2195e41

Please sign in to comment.