facebookexperimental / facebookexperimental/libunifex
Question about any_sender_of usage
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 210
- PR merge metrics
- No merged PRs in 30d
Description
First of all, libunifex is amazing ! Thanks for your great work.
I'm trying to implement networking stuff using libunifex, all the basic things are ok (send, recv, connect, accept, ...), but, I'm running into troubles when I try to implement ssl socket.
In this context I need to bind either a `send_sender` or a `recv_sender` to a `any_sender_of` (for the handshake procedure).
I minimized the area of the problem I'm encountering into your _io_uring_test.cpp_, in the `main` function I added:
```cpp
auto read_or_write = [&](bool read = true) -> any_sender_of<> {
if (read) {
return read_file(scheduler, "test.txt");
} else {
return write_new_file(scheduler, "test.txt");
}
};
sync_wait(read_or_write());
```
Then I have the following error using *clang-11*:
```
In file included from <...>/libunifex/examples/linux/io_uring_test.cpp:24:
<...>/libunifex/include/unifex/let.hpp:76:5: error: no matching function for call to object of type 'const struct _set_error_fn'
unifex::set_error(std::move(op_.receiver_), (Error &&) error);
```
see: [example branch](https://github.com/Garcia6l20/libunifex/tree/bug/any_sender_of_no_set_error).
I am missing something ?
Is this actually the purpose of an `any_sender_of<...>` ?
Is the error handling part is just missing from `any_sender_of<...>` ?
Thanks !
Contributor guide
Assessment
This issue has not been assessed yet.