Skip to content
Merged
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
21 changes: 14 additions & 7 deletions include/boost/corosio/local_datagram.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ class local_datagram_socket;
Identifies the local datagram protocol for parameterizing
socket open() calls with a self-documenting type.

The family(), type(), and protocol() members are implemented
in the compiled library to avoid exposing platform socket
headers.
The family(), type(), and protocol() members return the
three integers passed to the operating system's socket()
call. Their values are platform-defined constants taken from
the system socket headers.

@note Not available on Windows. Windows does not support
AF_UNIX datagram sockets (SOCK_DGRAM).
Expand All @@ -36,16 +37,22 @@ class local_datagram_socket;
class BOOST_COROSIO_DECL local_datagram
{
public:
/// Return the address family (AF_UNIX).
/// Return the address family, the platform's `AF_UNIX` constant.
static int family() noexcept;

/// Return the socket type (SOCK_DGRAM).
/// Return the socket type, the platform's `SOCK_DGRAM` constant.
static int type() noexcept;

/// Return the protocol (0).
/** Return the protocol number, always `0`.

A value of `0` directs the operating system to select the
default protocol for an `AF_UNIX` `SOCK_DGRAM` socket. It
is not an index into a list of protocols: Unix domain
datagram sockets have only one, so `0` is the sole valid value.
*/
static int protocol() noexcept;

/// The associated socket type.
/// The socket type to use with this protocol, @ref local_datagram_socket.
using socket = local_datagram_socket;
};

Expand Down
23 changes: 15 additions & 8 deletions include/boost/corosio/local_stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ class local_stream_acceptor;
socket and acceptor open() calls with a self-documenting
type.

The family(), type(), and protocol() members are implemented
in the compiled library to avoid exposing platform socket
headers.
The family(), type(), and protocol() members return the
three integers passed to the operating system's socket()
call. Their values are platform-defined constants taken from
the system socket headers.

@par Example
@code
Expand All @@ -38,19 +39,25 @@ class local_stream_acceptor;
class BOOST_COROSIO_DECL local_stream
{
public:
/// Return the address family (AF_UNIX).
/// Return the address family, the platform's `AF_UNIX` constant.
static int family() noexcept;

/// Return the socket type (SOCK_STREAM).
/// Return the socket type, the platform's `SOCK_STREAM` constant.
static int type() noexcept;

/// Return the protocol (0).
/** Return the protocol number, always `0`.

A value of `0` directs the operating system to select the
default protocol for an `AF_UNIX` `SOCK_STREAM` socket. It
is not an index into a list of protocols: Unix domain
stream sockets have only one, so `0` is the sole valid value.
*/
static int protocol() noexcept;

/// The associated socket type.
/// The socket type to use with this protocol, @ref local_stream_socket.
using socket = local_stream_socket;

/// The associated acceptor type.
/// The acceptor type to use with this protocol, @ref local_stream_acceptor.
using acceptor = local_stream_acceptor;
};

Expand Down
13 changes: 7 additions & 6 deletions include/boost/corosio/tcp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ class tcp_acceptor;
(IPv4 or IPv6). It is used to parameterize socket and acceptor
`open()` calls with a self-documenting type.

The `family()`, `type()`, and `protocol()` members are
implemented in the compiled library to avoid exposing
platform socket headers. For an inline variant that includes
platform headers, use @ref native_tcp.
The `family()`, `type()`, and `protocol()` members return the
three integers passed to the operating system's `socket()`
call. Their values are platform-defined constants taken from
the system socket headers. For an inline variant that includes
those headers, use @ref native_tcp.

@par Example
@code
Expand Down Expand Up @@ -72,10 +73,10 @@ class BOOST_COROSIO_DECL tcp
/// Return the IP protocol (IPPROTO_TCP).
static int protocol() noexcept;

/// The associated socket type.
/// The socket type to use with this protocol, @ref tcp_socket.
using socket = tcp_socket;

/// The associated acceptor type.
/// The acceptor type to use with this protocol, @ref tcp_acceptor.
using acceptor = tcp_acceptor;

/// Test for equality.
Expand Down
11 changes: 6 additions & 5 deletions include/boost/corosio/udp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ class udp_socket;
(IPv4 or IPv6). It is used to parameterize `udp_socket::open()`
calls with a self-documenting type.

The `family()`, `type()`, and `protocol()` members are
implemented in the compiled library to avoid exposing
platform socket headers. For an inline variant that includes
platform headers, use @ref native_udp.
The `family()`, `type()`, and `protocol()` members return the
three integers passed to the operating system's `socket()`
call. Their values are platform-defined constants taken from
the system socket headers. For an inline variant that includes
those headers, use @ref native_udp.

@par Example
@code
Expand Down Expand Up @@ -69,7 +70,7 @@ class BOOST_COROSIO_DECL udp
/// Return the IP protocol (IPPROTO_UDP).
static int protocol() noexcept;

/// The associated socket type.
/// The socket type to use with this protocol, @ref udp_socket.
using socket = udp_socket;

/// Test for equality.
Expand Down
Loading