Skip to content

Add overloads for working with capy/corosio #280

Description

@R-Goc

When trying to write a simple server, I noticed that when writing to a corosio tcp_socket creating the const buffer for the write is rather ugly. Since these libraries are already so tied together methods/overloads for working with capy/corosio would be nice. For example this:

        http::response res;
        res.set_status(http::status::ok);
        auto [ec, n] = co_await m_socket.write_some(
            capy::const_buffer{res.buffer().data(), res.buffer().size()});

Unless I missed some very obvious method, there is no nice way to pass an http::request to write_some. Just .buffer() doesn't work as write_some doesn't accept a string_view.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions