Commit 0d121f35 authored by Dominik Charousset's avatar Dominik Charousset

Add comments and remove invalid_network_socket

parent 2e367398
......@@ -32,6 +32,7 @@
namespace caf {
namespace net {
/// A bidirectional network communication endpoint.
struct network_socket : abstract_socket<network_socket> {
using super = abstract_socket<network_socket>;
......@@ -42,10 +43,6 @@ struct network_socket : abstract_socket<network_socket> {
}
};
/// Identifies the invalid socket.
/// @relates network_socket
constexpr auto invalid_network_socket = network_socket{invalid_socket_id};
/// Enables or disables keepalive on `x`.
/// @relates network_socket
error keepalive(network_socket x, bool new_value);
......
......@@ -30,6 +30,7 @@
namespace caf {
namespace net {
/// A unidirectional communication endpoint for inter-process communication.
struct pipe_socket : abstract_socket<pipe_socket> {
using super = abstract_socket<pipe_socket>;
......
......@@ -132,7 +132,7 @@ error allow_sigpipe(network_socket x, bool new_value) {
error allow_udp_connreset(network_socket x, bool) {
// SIO_UDP_CONNRESET only exists on Windows
if (x == invalid_network_socket)
if (x == invalid_socket)
return make_error(sec::network_syscall_failed, "WSAIoctl",
"invalid socket");
return none;
......
......@@ -30,7 +30,7 @@ using namespace caf::net;
CAF_TEST_FIXTURE_SCOPE(network_socket_tests, host_fixture)
CAF_TEST(invalid socket) {
auto x = invalid_network_socket;
network_socket x;
CAF_CHECK_EQUAL(keepalive(x, true), sec::network_syscall_failed);
CAF_CHECK_EQUAL(tcp_nodelay(x, true), sec::network_syscall_failed);
CAF_CHECK_EQUAL(allow_sigpipe(x, true), sec::network_syscall_failed);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment