MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / enqueue_message

Method enqueue_message

tools/rtpsrelay/RelayHandler.cpp:199–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199void RelayHandler::enqueue_message(const ACE_INET_Addr& addr,
200 const OpenDDS::DCPS::Lockable_Message_Block_Ptr& msg,
201 const OpenDDS::DCPS::MonotonicTimePoint& now,
202 MessageType type)
203{
204 const Element out(addr, msg, now, type);
205 if (config_.synchronous_output()) {
206 size_t total_bytes;
207
208 if (send_i(out, total_bytes) < 0) {
209 HANDLER_ERROR((LM_ERROR, "(%P|%t) ERROR: RelayHandler::enqueue_message %C failed to send to %C: %m\n",
210 name_.c_str(), OpenDDS::DCPS::LogAddr(out.address).c_str()));
211 stats_reporter_.dropped_message(total_bytes, OpenDDS::DCPS::TimeDuration::zero_value, OpenDDS::DCPS::TimeDuration::zero_value, now, out.type);
212 } else {
213 stats_reporter_.output_message(total_bytes, OpenDDS::DCPS::TimeDuration::zero_value, OpenDDS::DCPS::TimeDuration::zero_value, now, out.type);
214 }
215
216 } else {
217 ACE_GUARD(ACE_Thread_Mutex, g, outgoing_mutex_);
218
219 const auto empty = outgoing_.empty();
220
221 outgoing_.push(out);
222 stats_reporter_.max_queue_size(outgoing_.size(), now);
223 if (empty) {
224 reactor()->register_handler(this, WRITE_MASK);
225 }
226 }
227}
228
229ssize_t RelayHandler::send_i(const Element& out,
230 size_t& total_bytes)

Callers

nothing calls this directly

Calls 8

synchronous_outputMethod · 0.80
register_handlerMethod · 0.80
dropped_messageMethod · 0.45
output_messageMethod · 0.45
emptyMethod · 0.45
pushMethod · 0.45
max_queue_sizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected