include/boost/corosio/native/detail/epoll/epoll_tcp_socket.hpp
100.0% Lines (2/2)
100.0% List of functions (1/1)
Functions (1)
Function
Calls
Lines
Blocks
boost::corosio::detail::epoll_tcp_socket::shutdown(boost::corosio::shutdown_type)
:64
3x
100.0%
100.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_EPOLL_EPOLL_TCP_SOCKET_HPP | ||
| 11 | #define BOOST_COROSIO_NATIVE_DETAIL_EPOLL_EPOLL_TCP_SOCKET_HPP | ||
| 12 | |||
| 13 | #include <boost/corosio/detail/platform.hpp> | ||
| 14 | |||
| 15 | #if BOOST_COROSIO_HAS_EPOLL | ||
| 16 | |||
| 17 | #include <boost/corosio/native/detail/reactor/reactor_stream_socket.hpp> | ||
| 18 | #include <boost/corosio/native/detail/epoll/epoll_op.hpp> | ||
| 19 | #include <boost/capy/ex/executor_ref.hpp> | ||
| 20 | |||
| 21 | namespace boost::corosio::detail { | ||
| 22 | |||
| 23 | class epoll_tcp_service; | ||
| 24 | |||
| 25 | /// Stream socket implementation for epoll backend. | ||
| 26 | class epoll_tcp_socket final | ||
| 27 | : public reactor_stream_socket< | ||
| 28 | epoll_tcp_socket, | ||
| 29 | epoll_tcp_service, | ||
| 30 | epoll_connect_op, | ||
| 31 | epoll_read_op, | ||
| 32 | epoll_write_op, | ||
| 33 | descriptor_state> | ||
| 34 | { | ||
| 35 | friend class epoll_tcp_service; | ||
| 36 | |||
| 37 | public: | ||
| 38 | explicit epoll_tcp_socket(epoll_tcp_service& svc) noexcept; | ||
| 39 | ~epoll_tcp_socket() override; | ||
| 40 | |||
| 41 | std::coroutine_handle<> connect( | ||
| 42 | std::coroutine_handle<>, | ||
| 43 | capy::executor_ref, | ||
| 44 | endpoint, | ||
| 45 | std::stop_token, | ||
| 46 | std::error_code*) override; | ||
| 47 | |||
| 48 | std::coroutine_handle<> read_some( | ||
| 49 | std::coroutine_handle<>, | ||
| 50 | capy::executor_ref, | ||
| 51 | buffer_param, | ||
| 52 | std::stop_token, | ||
| 53 | std::error_code*, | ||
| 54 | std::size_t*) override; | ||
| 55 | |||
| 56 | std::coroutine_handle<> write_some( | ||
| 57 | std::coroutine_handle<>, | ||
| 58 | capy::executor_ref, | ||
| 59 | buffer_param, | ||
| 60 | std::stop_token, | ||
| 61 | std::error_code*, | ||
| 62 | std::size_t*) override; | ||
| 63 | |||
| 64 | 3x | std::error_code shutdown(tcp_socket::shutdown_type what) noexcept override | |
| 65 | { | ||
| 66 | 3x | return do_shutdown(static_cast<int>(what)); | |
| 67 | } | ||
| 68 | |||
| 69 | void cancel() noexcept override; | ||
| 70 | void close_socket() noexcept; | ||
| 71 | }; | ||
| 72 | |||
| 73 | } // namespace boost::corosio::detail | ||
| 74 | |||
| 75 | #endif // BOOST_COROSIO_HAS_EPOLL | ||
| 76 | |||
| 77 | #endif // BOOST_COROSIO_NATIVE_DETAIL_EPOLL_EPOLL_TCP_SOCKET_HPP | ||
| 78 |