Go to the documentation of this file.
22 template <
typename Socket >
35 using base_type_t::base_type_t;
67 const auto desired_size =
75 this->m_file_descriptor );
77 if( desired_size != n )
92 static_cast< std::size_t
>( desired_size ) },
93 asio_ns::bind_executor(
101 asio_convertible_error_t::async_write_call_failed ),
114 return [
this, ctx = this->shared_from_this() ]
116 (
const asio_ns::error_code & ec, std::size_t written ) noexcept
constexpr const_buffer_t const_buffer(const void *str, std::size_t size) noexcept
asio_ns::error_code make_asio_compaible_error(asio_convertible_error_t err) noexcept
Make restinio error_code compatible with asio_ns::error_code.
file_size_t m_remained_size
file_descriptor_t m_file_descriptor
sendfile_operation_runner_t(const sendfile_operation_runner_t &)=delete
A base runner of sendfile operation (keeps all the data).
void init_next_write() noexcept
after_sendfile_cb_t m_after_sendfile_cb
file_offset_t m_next_write_offset
file_size_t m_transfered_size
std::unique_ptr< char[] > m_buffer
sendfile_operation_runner_t(sendfile_operation_runner_t &&)=delete
default_asio_executor m_executor
virtual void start() override
A runner of sendfile operation.
auto make_error_code(const Error_Type &e) noexcept
auto make_async_write_handler() noexcept
Helper method for making a lambda for async_write completion handler.
const file_size_t m_chunk_size
sendfile_operation_runner_t & operator=(const sendfile_operation_runner_t &)=delete