Skip to content

Commit

Permalink
Socket write accepts multiple buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
dvsku committed Jun 16, 2024
1 parent ea784d8 commit caa711f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/libnetwrk/net/tcp/socket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ namespace libnetwrk::tcp {
co_return result;
}

asio::awaitable<std::tuple<std::error_code, size_t>> async_write(buffer& buffer) {
asio::awaitable<std::tuple<std::error_code, size_t>> async_write(const std::vector<asio::const_buffer>& buffer) {
std::tuple<std::error_code, size_t> result = co_await asio::async_write(m_socket,
asio::buffer(buffer.data(), buffer.size()), asio::as_tuple(asio::use_awaitable));
buffer, asio::as_tuple(asio::use_awaitable));

co_return result;
}
Expand Down

0 comments on commit caa711f

Please sign in to comment.