| 226 | } |
| 227 | |
| 228 | inline void UDPSender::send(const std::string& message) noexcept { |
| 229 | m_errorMessage.clear(); |
| 230 | |
| 231 | // If batching is on, accumulate messages in the queue |
| 232 | if (m_batchsize > 0) { |
| 233 | queueMessage(message); |
| 234 | return; |
| 235 | } |
| 236 | |
| 237 | // Or send it right now |
| 238 | sendToDaemon(message); |
| 239 | } |
| 240 | |
| 241 | inline void UDPSender::queueMessage(const std::string& message) noexcept { |
| 242 | // We aquire a lock but only if we actually need to (i.e. there is a thread also accessing the queue) |
no test coverage detected