Commit 4ee02ef5 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[2903] an unrelated small optimization: use const_buffers_1 for send.

asio::buffer is internally converted to this form, so this is (in theory)
more efficient.
parent 65bbffe7
......@@ -152,13 +152,12 @@ SyncUDPServer::handleRead(const asio::error_code& ec, const size_t length) {
}
asio::error_code ec;
socket_->send_to(asio::buffer(output_buffer_->getData(),
socket_->send_to(asio::const_buffers_1(output_buffer_->getData(),
output_buffer_->getLength()),
sender_, 0, ec);
if (ec) {
LOG_ERROR(logger, ASIODNS_UDP_SYNC_SEND_FAIL).
arg(sender_.address().to_string()).
arg(ec.message());
arg(sender_.address().to_string()).arg(ec.message());
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment