LCOV - code coverage report
Current view: top level - corosio/native/detail/select - select_local_stream_socket.hpp (source / functions) Coverage Total Missed
Test: coverage_remapped.info Lines: 0.0 % 2 2
Test Date: 2026-04-13 22:45:57 Functions: 0.0 % 1 1

           TLA  Line data    Source code
       1                 : //
       2                 : // Copyright (c) 2026 Michael Vandeberg
       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_LOCAL_STREAM_SOCKET_HPP
      11                 : #define BOOST_COROSIO_NATIVE_DETAIL_SELECT_SELECT_LOCAL_STREAM_SOCKET_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_stream_socket.hpp>
      18                 : #include <boost/corosio/local_endpoint.hpp>
      19                 : #include <boost/corosio/native/detail/reactor/reactor_op.hpp>
      20                 : #include <boost/corosio/native/detail/select/select_op.hpp>
      21                 : #include <boost/corosio/local_stream_socket.hpp>
      22                 : #include <boost/capy/ex/executor_ref.hpp>
      23                 : 
      24                 : namespace boost::corosio::detail {
      25                 : 
      26                 : // Forward declarations
      27                 : class select_local_stream_service;
      28                 : class select_local_stream_socket;
      29                 : class select_local_stream_acceptor;
      30                 : 
      31                 : /// Base operation for local stream sockets on select.
      32                 : struct select_local_stream_op
      33                 :     : reactor_op<select_local_stream_socket, select_local_stream_acceptor>
      34                 : {
      35                 :     void operator()() override;
      36                 : };
      37                 : 
      38                 : /// Connect operation for local stream sockets.
      39                 : struct select_local_connect_op final
      40                 :     : reactor_connect_op<select_local_stream_op, local_endpoint>
      41                 : {
      42                 :     void operator()() override;
      43                 :     void cancel() noexcept override;
      44                 : };
      45                 : 
      46                 : /// Scatter-read operation for local stream sockets.
      47                 : struct select_local_read_op final : reactor_read_op<select_local_stream_op>
      48                 : {
      49                 :     void cancel() noexcept override;
      50                 : };
      51                 : 
      52                 : /// Gather-write operation for local stream sockets.
      53                 : struct select_local_write_op final
      54                 :     : reactor_write_op<select_local_stream_op, select_write_policy>
      55                 : {
      56                 :     void cancel() noexcept override;
      57                 : };
      58                 : 
      59                 : /// Accept operation for local stream sockets.
      60                 : struct select_local_accept_op final
      61                 :     : reactor_accept_op<select_local_stream_op, select_accept_policy>
      62                 : {
      63                 :     void operator()() override;
      64                 :     void cancel() noexcept override;
      65                 : };
      66                 : 
      67                 : /// Stream socket implementation for local (Unix) sockets on select.
      68                 : class select_local_stream_socket final
      69                 :     : public reactor_stream_socket<
      70                 :           select_local_stream_socket,
      71                 :           select_local_stream_service,
      72                 :           select_local_connect_op,
      73                 :           select_local_read_op,
      74                 :           select_local_write_op,
      75                 :           select_descriptor_state,
      76                 :           local_stream_socket::implementation,
      77                 :           corosio::local_endpoint>
      78                 : {
      79                 :     friend class select_local_stream_service;
      80                 : 
      81                 : public:
      82                 :     explicit select_local_stream_socket(
      83                 :         select_local_stream_service& svc) noexcept;
      84                 :     ~select_local_stream_socket() override;
      85                 : 
      86                 :     std::coroutine_handle<> connect(
      87                 :         std::coroutine_handle<>,
      88                 :         capy::executor_ref,
      89                 :         corosio::local_endpoint,
      90                 :         std::stop_token,
      91                 :         std::error_code*) override;
      92                 : 
      93 MIS           0 :     std::error_code shutdown(
      94                 :         local_stream_socket::shutdown_type what) noexcept override
      95                 :     {
      96               0 :         return do_shutdown(static_cast<int>(what));
      97                 :     }
      98                 : 
      99                 :     std::coroutine_handle<> read_some(
     100                 :         std::coroutine_handle<>,
     101                 :         capy::executor_ref,
     102                 :         buffer_param,
     103                 :         std::stop_token,
     104                 :         std::error_code*,
     105                 :         std::size_t*) override;
     106                 : 
     107                 :     std::coroutine_handle<> write_some(
     108                 :         std::coroutine_handle<>,
     109                 :         capy::executor_ref,
     110                 :         buffer_param,
     111                 :         std::stop_token,
     112                 :         std::error_code*,
     113                 :         std::size_t*) override;
     114                 : 
     115                 :     void cancel() noexcept override;
     116                 :     void close_socket() noexcept;
     117                 :     native_handle_type release_socket() noexcept override;
     118                 : };
     119                 : 
     120                 : } // namespace boost::corosio::detail
     121                 : 
     122                 : #endif // BOOST_COROSIO_HAS_SELECT
     123                 : 
     124                 : #endif // BOOST_COROSIO_NATIVE_DETAIL_SELECT_SELECT_LOCAL_STREAM_SOCKET_HPP
        

Generated by: LCOV version 2.3