100.00% Lines (6/6) 100.00% Functions (3/3)
TLA Baseline Branch
Line Hits Code Line Hits Code
1   // 1   //
2   // Copyright (c) 2026 Michael Vandeberg 2   // Copyright (c) 2026 Michael Vandeberg
3   // 3   //
4   // Distributed under the Boost Software License, Version 1.0. (See accompanying 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) 5   // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6   // 6   //
7   // Official repository: https://github.com/cppalliance/corosio 7   // Official repository: https://github.com/cppalliance/corosio
8   // 8   //
9   9  
10   #include <boost/corosio/local_stream.hpp> 10   #include <boost/corosio/local_stream.hpp>
11   #include <boost/corosio/detail/platform.hpp> 11   #include <boost/corosio/detail/platform.hpp>
12   12  
13   #if BOOST_COROSIO_POSIX 13   #if BOOST_COROSIO_POSIX
14   #include <sys/socket.h> 14   #include <sys/socket.h>
15   #include <sys/un.h> 15   #include <sys/un.h>
16   #elif BOOST_COROSIO_HAS_IOCP 16   #elif BOOST_COROSIO_HAS_IOCP
17   #include <WinSock2.h> 17   #include <WinSock2.h>
18   #ifndef AF_UNIX 18   #ifndef AF_UNIX
19   #define AF_UNIX 1 19   #define AF_UNIX 1
20   #endif 20   #endif
21   #endif 21   #endif
22   22  
23   namespace boost::corosio { 23   namespace boost::corosio {
24   24  
25   int 25   int
HITCBC 26   20 local_stream::family() noexcept 26   20 local_stream::family() noexcept
27   { 27   {
28   #if BOOST_COROSIO_POSIX || BOOST_COROSIO_HAS_IOCP 28   #if BOOST_COROSIO_POSIX || BOOST_COROSIO_HAS_IOCP
HITCBC 29   20 return AF_UNIX; 29   20 return AF_UNIX;
30   #else 30   #else
31   return 0; 31   return 0;
32   #endif 32   #endif
33   } 33   }
34   34  
35   int 35   int
HITCBC 36   20 local_stream::type() noexcept 36   20 local_stream::type() noexcept
37   { 37   {
38   #if BOOST_COROSIO_POSIX || BOOST_COROSIO_HAS_IOCP 38   #if BOOST_COROSIO_POSIX || BOOST_COROSIO_HAS_IOCP
HITCBC 39   20 return SOCK_STREAM; 39   20 return SOCK_STREAM;
40   #else 40   #else
41   return 0; 41   return 0;
42   #endif 42   #endif
43   } 43   }
44   44  
45   int 45   int
HITCBC 46   20 local_stream::protocol() noexcept 46   20 local_stream::protocol() noexcept
47   { 47   {
HITCBC 48   20 return 0; 48   20 return 0;
49   } 49   }
50   50  
51   } // namespace boost::corosio 51   } // namespace boost::corosio