src/corosio/src/local_stream.cpp

100.0% Lines (6/6) 100.0% List of functions (3/3)
local_stream.cpp
f(x) Functions (3)
Line TLA Hits 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 #include <boost/corosio/local_stream.hpp>
11 #include <boost/corosio/detail/platform.hpp>
12
13 #if BOOST_COROSIO_POSIX
14 #include <sys/socket.h>
15 #include <sys/un.h>
16 #elif BOOST_COROSIO_HAS_IOCP
17 #include <WinSock2.h>
18 #ifndef AF_UNIX
19 #define AF_UNIX 1
20 #endif
21 #endif
22
23 namespace boost::corosio {
24
25 int
26 20x local_stream::family() noexcept
27 {
28 #if BOOST_COROSIO_POSIX || BOOST_COROSIO_HAS_IOCP
29 20x return AF_UNIX;
30 #else
31 return 0;
32 #endif
33 }
34
35 int
36 20x local_stream::type() noexcept
37 {
38 #if BOOST_COROSIO_POSIX || BOOST_COROSIO_HAS_IOCP
39 20x return SOCK_STREAM;
40 #else
41 return 0;
42 #endif
43 }
44
45 int
46 20x local_stream::protocol() noexcept
47 {
48 20x return 0;
49 }
50
51 } // namespace boost::corosio
52