title: OpenSplice DDS: Publish, until some timeout
body: <p>I'm learning every day more about dds, so my question my sound weird. I hope it makes sense.</p>
  
  <p>One of the requirements of some dds wrapper I'm writing, is that it times out after some timeout period if it fails to write. <strong>My question:</strong> How can I do that?</p>
  
  <p>On <a href="http://download.prismtech.com/docs/Vortex/html/ospl/DDSTutorial/readandwrite.html" rel="nofollow noreferrer">Prism Tech's website's tutorial</a>, there's explanation on how to use a <code>WaitSet</code> to block a read operation, but what about write?</p>
  
  <p>Here's some code including the question:</p>
  
  <pre><code>dds::domain::DomainParticipant dp(0);
  dds::topic::Topic&lt;MyType&gt; topic(dp, "MyTopic");
  dds::pub::Publisher pub(dp);
  dds::pub::DataWriter&lt;MyType&gt; dw(pub, topic);
  
  MyType t;
  dw.write(t); //how can I make this block for 5 seconds (tops), and then throw an error on failure?
  </code></pre>
  
  <p>I noticed there exists a function in the API <a href="http://dev.opensplice.org/releases/downloads/docs/isocpp/html/classdds_1_1pub_1_1_data_writer.html#aaa79bd56ae4e8980a39f8c8a331df4b7" rel="nofollow noreferrer"><code>DataWriter::wait_for_acknowledgements(int timeout)</code></a>, but this seems to be bound to the <code>DataWriter</code> object, not to the specific call of writing. Can I bind it with the call above?</p>