include/boost/corosio/native/detail/select/select_tcp_acceptor.hpp

-% Lines (0/0) -% List of functions (0/0) -% Branches (0/0)
Line TLA Hits Source Code
1 //
2 // Copyright (c) 2026 Steve Gerbino
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 // Official repository: https://github.com/cppalliance/corosio
8 //
9
10 #ifndef BOOST_COROSIO_NATIVE_DETAIL_SELECT_SELECT_TCP_ACCEPTOR_HPP
11 #define BOOST_COROSIO_NATIVE_DETAIL_SELECT_SELECT_TCP_ACCEPTOR_HPP
12
13 #include <boost/corosio/detail/platform.hpp>
14
15 #if BOOST_COROSIO_HAS_SELECT
16
17 #include <boost/corosio/native/detail/reactor/reactor_acceptor.hpp>
18 #include <boost/corosio/native/detail/select/select_op.hpp>
19 #include <boost/capy/ex/executor_ref.hpp>
20
21 namespace boost::corosio::detail {
22
23 class select_tcp_acceptor_service;
24
25 /// Acceptor implementation for select backend.
26 class select_tcp_acceptor final
27 : public reactor_acceptor<
28 select_tcp_acceptor,
29 select_tcp_acceptor_service,
30 select_op,
31 select_accept_op,
32 select_descriptor_state>
33 {
34 friend class select_tcp_acceptor_service;
35
36 public:
37 explicit select_tcp_acceptor(select_tcp_acceptor_service& svc) noexcept;
38
39 std::coroutine_handle<> accept(
40 std::coroutine_handle<>,
41 capy::executor_ref,
42 std::stop_token,
43 std::error_code*,
44 io_object::implementation**) override;
45
46 void cancel() noexcept override;
47 void close_socket() noexcept;
48 };
49
50 } // namespace boost::corosio::detail
51
52 #endif // BOOST_COROSIO_HAS_SELECT
53
54 #endif // BOOST_COROSIO_NATIVE_DETAIL_SELECT_SELECT_TCP_ACCEPTOR_HPP
55