Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/compilers.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"latest_cxxstd": "20",
"cxx": "g++",
"cc": "gcc",
"runs_on": "windows-2022",
"runs_on": "windows-2025",
"b2_toolset": "gcc",
"generator": "MinGW Makefiles",
"shared": false,
Expand Down
8 changes: 7 additions & 1 deletion include/boost/corosio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@
#include <boost/corosio/local_stream.hpp>
#include <boost/corosio/local_stream_socket.hpp>
#include <boost/corosio/local_stream_acceptor.hpp>
#include <boost/corosio/local_socket_pair.hpp>

// local_datagram.hpp and local_datagram_socket.hpp are POSIX-only;
// Windows does not support AF_UNIX datagram sockets (SOCK_DGRAM).
#include <boost/corosio/detail/platform.hpp>
#if BOOST_COROSIO_POSIX
#include <boost/corosio/local_datagram.hpp>
#include <boost/corosio/local_datagram_socket.hpp>
#include <boost/corosio/local_socket_pair.hpp>
#endif

#include <boost/corosio/tls_context.hpp>
#include <boost/corosio/openssl_stream.hpp>
Expand Down
4 changes: 0 additions & 4 deletions include/boost/corosio/backend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,6 @@ class win_local_stream_socket;
class win_local_stream_service;
class win_local_stream_acceptor;
class win_local_stream_acceptor_service;
class win_local_dgram_socket;
class win_local_dgram_service;

class win_signal;
class win_signals;
Expand Down Expand Up @@ -251,8 +249,6 @@ struct iocp_t
using local_stream_service_type = detail::win_local_stream_service;
using local_stream_acceptor_type = detail::win_local_stream_acceptor;
using local_stream_acceptor_service_type = detail::win_local_stream_acceptor_service;
using local_datagram_socket_type = detail::win_local_dgram_socket;
using local_datagram_service_type = detail::win_local_dgram_service;
/// @}

using signal_type = detail::win_signal;
Expand Down
6 changes: 6 additions & 0 deletions include/boost/corosio/detail/local_datagram_service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
#define BOOST_COROSIO_DETAIL_LOCAL_DATAGRAM_SERVICE_HPP

#include <boost/corosio/detail/config.hpp>
#include <boost/corosio/detail/platform.hpp>

#if BOOST_COROSIO_POSIX

#include <boost/corosio/local_datagram_socket.hpp>
#include <boost/corosio/local_endpoint.hpp>
#include <boost/capy/ex/execution_context.hpp>
Expand Down Expand Up @@ -90,4 +94,6 @@ class BOOST_COROSIO_DECL local_datagram_service

} // namespace boost::corosio::detail

#endif // BOOST_COROSIO_POSIX

#endif // BOOST_COROSIO_DETAIL_LOCAL_DATAGRAM_SERVICE_HPP
8 changes: 8 additions & 0 deletions include/boost/corosio/local_datagram.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#define BOOST_COROSIO_LOCAL_DATAGRAM_HPP

#include <boost/corosio/detail/config.hpp>
#include <boost/corosio/detail/platform.hpp>

#if BOOST_COROSIO_POSIX

namespace boost::corosio {

Expand All @@ -25,6 +28,9 @@ class local_datagram_socket;
in the compiled library to avoid exposing platform socket
headers.

@note Not available on Windows. Windows does not support
AF_UNIX datagram sockets (SOCK_DGRAM).

@see local_datagram_socket
*/
class BOOST_COROSIO_DECL local_datagram
Expand All @@ -45,4 +51,6 @@ class BOOST_COROSIO_DECL local_datagram

} // namespace boost::corosio

#endif // BOOST_COROSIO_POSIX

#endif // BOOST_COROSIO_LOCAL_DATAGRAM_HPP
9 changes: 9 additions & 0 deletions include/boost/corosio/local_datagram_socket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

#include <boost/corosio/detail/config.hpp>
#include <boost/corosio/detail/platform.hpp>

#if BOOST_COROSIO_POSIX

#include <boost/corosio/detail/except.hpp>
#include <boost/corosio/detail/native_handle.hpp>
#include <boost/corosio/detail/op_base.hpp>
Expand Down Expand Up @@ -56,6 +59,10 @@ namespace boost::corosio {
kernel filters incoming datagrams to those from the
connected peer.

@note Not available on Windows. Windows does not support
AF_UNIX datagram sockets (SOCK_DGRAM). Attempting to
open this socket on Windows will fail.

@par Cancellation
All asynchronous operations support cancellation through
`std::stop_token` via the affine protocol, or explicitly
Expand Down Expand Up @@ -871,4 +878,6 @@ class BOOST_COROSIO_DECL local_datagram_socket : public io_object

} // namespace boost::corosio

#endif // BOOST_COROSIO_POSIX

#endif // BOOST_COROSIO_LOCAL_DATAGRAM_SOCKET_HPP
18 changes: 11 additions & 7 deletions include/boost/corosio/local_socket_pair.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

#include <boost/corosio/detail/config.hpp>
#include <boost/corosio/detail/platform.hpp>
#include <boost/corosio/local_stream_socket.hpp>

#if BOOST_COROSIO_POSIX

#include <boost/corosio/local_stream_socket.hpp>
#include <boost/corosio/local_datagram_socket.hpp>
#endif

#include <utility>

Expand All @@ -26,9 +26,10 @@ class io_context;

/** Create a connected pair of local stream sockets.

Uses socketpair(AF_UNIX, SOCK_STREAM) to create two
pre-connected sockets. Data written to one can be read
from the other.
On POSIX, uses socketpair(AF_UNIX, SOCK_STREAM). On Windows,
emulates socketpair by creating a temporary listener, connecting,
and accepting. Data written to one socket can be read from the
other.

@param ctx The I/O context for the sockets.

Expand All @@ -39,11 +40,15 @@ class io_context;
BOOST_COROSIO_DECL std::pair<local_stream_socket, local_stream_socket>
make_local_stream_pair(io_context& ctx);

#if BOOST_COROSIO_POSIX
/** Create a connected pair of local datagram sockets.

Uses socketpair(AF_UNIX, SOCK_DGRAM) to create two
pre-connected sockets.

@note Not available on Windows. Windows does not support
AF_UNIX datagram sockets.

@param ctx The I/O context for the sockets.

@return A pair of connected local datagram sockets.
Expand All @@ -52,9 +57,8 @@ make_local_stream_pair(io_context& ctx);
*/
BOOST_COROSIO_DECL std::pair<local_datagram_socket, local_datagram_socket>
make_local_datagram_pair(io_context& ctx);
#endif

} // namespace boost::corosio

#endif // BOOST_COROSIO_POSIX

#endif // BOOST_COROSIO_LOCAL_SOCKET_PAIR_HPP
Loading
Loading