Commit 01b171f3 authored by Dominik Charousset's avatar Dominik Charousset

Consistently use a less-verbose commenting style

parent 7f922342
/******************************************************************************\ // This example is an implementation of the classical Dining Philosophers
* This example is an implementation of the classical Dining Philosophers * // exercise using only CAF's event-based actor implementation.
* exercise using only libcaf's event-based actor implementation. *
\******************************************************************************/
#include <chrono> #include <chrono>
#include <iostream> #include <iostream>
......
/******************************************************************************\ // This example is a very basic, non-interactive math service implemented for
* This example is a very basic, non-interactive math service implemented * // both the blocking and the event-based API.
* for both the blocking and the event-based API. *
\******************************************************************************/
#include <iostream> #include <iostream>
......
/******************************************************************************\ // This example is a very basic, non-interactive math service implemented for
* This example is a very basic, non-interactive math service implemented * // both the blocking and the event-based API.
* for both the blocking and the event-based API. *
\******************************************************************************/
#include <cstdint> #include <cstdint>
#include <iostream> #include <iostream>
......
/******************************************************************************\ // This example illustrates how to do time-triggered loops in CAF.
* This example illustrates how to do time-triggered loops in libcaf. *
\******************************************************************************/
#include <algorithm> #include <algorithm>
#include <chrono> #include <chrono>
......
/******************************************************************************\ // A very basic, interactive divider.
* A very basic, interactive divider. *
\******************************************************************************/
#include <iostream> #include <iostream>
......
/******************************************************************************\ // This example illustrates semantics of request().{then|await|receive}.
* Illustrates semantics of request().{then|await|receive}. *
\******************************************************************************/
#include <chrono> #include <chrono>
#include <cstdint> #include <cstdint>
......
/******************************************************************************\ // This example is a very basic, non-interactive math service implemented using
* This example is a very basic, non-interactive math service implemented * // typed actors.
* using typed actors. *
\******************************************************************************/
#include "caf/all.hpp" #include "caf/all.hpp"
#include <cassert> #include <cassert>
......
/******************************************************************************\ // This example program represents a minimal GUI chat program based on group
* This example program represents a minimal GUI chat program * // communication. This chat program is compatible to the terminal version in
* based on group communication. This chat program is compatible to the * // length_prefix_framing/chat-server.cpp.
* terminal version in length_prefix_framing/chat-server.cpp. * //
* * // Setup for a minimal chat between "alice" and "bob":
* Setup for a minimal chat between "alice" and "bob": * // - chat-server -p 4242
* - chat-server -p 4242 * // - qt_group_chat -H localhost -p 4242 -n alice
* - qt_group_chat -H localhost -p 4242 -n alice * // - qt_group_chat -H localhost -p 4242 -n bob
* - qt_group_chat -H localhost -p 4242 -n bob *
\******************************************************************************/
#include <cstdlib> #include <cstdlib>
#include <iostream> #include <iostream>
......
/******************************************************************************\ // This program is a distributed version of the math_actor example. Client and
* This program is a distributed version of the math_actor example. * // server use a stateless request/response protocol and the client is failure
* Client and server use a stateless request/response protocol and the client * // resilient by using a FIFO request queue. The client auto-reconnects and also
* is failure resilient by using a FIFO request queue. * // allows for server reconfiguration.
* The client auto-reconnects and also allows for server reconfiguration. * //
* * // Run server at port 4242:
* Run server at port 4242: * // - distributed_calculator -s -p 4242
* - distributed_calculator -s -p 4242 * //
* * // Run client at the same host:
* Run client at the same host: * // - distributed_calculator -c -p 4242
* - distributed_calculator -c -p 4242 *
\******************************************************************************/
#include <array> #include <array>
#include <cassert> #include <cassert>
......
...@@ -97,9 +97,7 @@ public: ...@@ -97,9 +97,7 @@ public:
/// Returns the system that created this actor (or proxy). /// Returns the system that created this actor (or proxy).
actor_system& home_system() const noexcept; actor_system& home_system() const noexcept;
/**************************************************************************** // -- here be dragons: end of public interface -------------------------------
* here be dragons: end of public interface *
****************************************************************************/
/// @cond PRIVATE /// @cond PRIVATE
......
...@@ -135,6 +135,33 @@ ...@@ -135,6 +135,33 @@
/// @namespace caf::policy /// @namespace caf::policy
/// Contains policies encapsulating characteristics or algorithms. /// Contains policies encapsulating characteristics or algorithms.
/// ///
/// @namespace caf::telemetry
/// Contains classes and functions for collecting telemetry data.
///
/// @namespace caf::net
/// Contains all classes and functions related to network protocols.
///
/// @namespace caf::net::dsl
/// Contains building blocks to assemble protocol stacks in a declarative way.
///
/// @namespace caf::net::http
/// Contains an implementation for HTTP.
///
/// @namespace caf::net::ssl
/// Contains wrappers for convenient access to SSL.
///
/// @namespace caf::net::octet_stream
/// Contains classes and utilities for transports that operate on raw octets.
///
/// @namespace caf::net::prometheus
/// Contains a scraper for exposing metrics from an actor system to Prometheus.
///
/// @namespace caf::net::web_socket
/// Contains an implementation for message exchange over the WebSocket protocol.
///
/// @namespace caf::net::lp
/// Contains an implementation for message exchange over length-prefix framing.
///
/// @namespace caf::io /// @namespace caf::io
/// Contains all IO-related classes and functions. /// Contains all IO-related classes and functions.
/// ///
......
/****************************************************************************** // This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
* ____ _ _____ * // the main distribution directory for license terms and copyright or visit
* / ___| / \ | ___| C++ * // https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2018 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#pragma once #pragma once
......
/****************************************************************************** // This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
* ____ _ _____ * // the main distribution directory for license terms and copyright or visit
* / ___| / \ | ___| C++ * // https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2021 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#pragma once #pragma once
......
...@@ -2,41 +2,39 @@ ...@@ -2,41 +2,39 @@
// the main distribution directory for license terms and copyright or visit // the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE. // https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
/******************************************************************************\ // Based on http://homes.esat.kuleuven.be/~cosicart/ps/AB-9601/rmd160.h;
* Based on http://homes.esat.kuleuven.be/~cosicart/ps/AB-9601/rmd160.h; // original header:
* original header: //
* // AUTHOR: Antoon Bosselaers, ESAT-COSIC
* AUTHOR: Antoon Bosselaers, ESAT-COSIC // DATE: 1 March 1996
* DATE: 1 March 1996 // VERSION: 1.0
* VERSION: 1.0 //
* // Copyright (c) Katholieke Universiteit Leuven
* Copyright (c) Katholieke Universiteit Leuven // 1996, All Rights Reserved
* 1996, All Rights Reserved //
* // Conditions for use of the RIPEMD-160 Software
* Conditions for use of the RIPEMD-160 Software //
* // The RIPEMD-160 software is freely available for use under the terms and
* The RIPEMD-160 software is freely available for use under the terms and // conditions described hereunder, which shall be deemed to be accepted by
* conditions described hereunder, which shall be deemed to be accepted by // any user of the software and applicable on any use of the software:
* any user of the software and applicable on any use of the software: //
* // 1. K.U.Leuven Department of Electrical Engineering-ESAT/COSIC shall for
* 1. K.U.Leuven Department of Electrical Engineering-ESAT/COSIC shall for // all purposes be considered the owner of the RIPEMD-160 software and of
* all purposes be considered the owner of the RIPEMD-160 software and of // all copyright, trade secret, patent or other intellectual property
* all copyright, trade secret, patent or other intellectual property // rights therein.
* rights therein. // 2. The RIPEMD-160 software is provided on an "as is" basis without
* 2. The RIPEMD-160 software is provided on an "as is" basis without // warranty of any sort, express or implied. K.U.Leuven makes no
* warranty of any sort, express or implied. K.U.Leuven makes no // representation that the use of the software will not infringe any
* representation that the use of the software will not infringe any // patent or proprietary right of third parties. User will indemnify
* patent or proprietary right of third parties. User will indemnify // K.U.Leuven and hold K.U.Leuven harmless from any claims or liabilities
* K.U.Leuven and hold K.U.Leuven harmless from any claims or liabilities // which may arise as a result of its use of the software. In no
* which may arise as a result of its use of the software. In no // circumstances K.U.Leuven R&D will be held liable for any deficiency,
* circumstances K.U.Leuven R&D will be held liable for any deficiency, // fault or other mishappening with regard to the use or performance of
* fault or other mishappening with regard to the use or performance of // the software.
* the software. // 3. User agrees to give due credit to K.U.Leuven in scientific publications
* 3. User agrees to give due credit to K.U.Leuven in scientific publications // or communications in relation with the use of the RIPEMD-160 software
* or communications in relation with the use of the RIPEMD-160 software // as follows: RIPEMD-160 software written by Antoon Bosselaers,
* as follows: RIPEMD-160 software written by Antoon Bosselaers, // available at http://www.esat.kuleuven.be/~cosicart/ps/AB-9601/.
* available at http://www.esat.kuleuven.be/~cosicart/ps/AB-9601/.
\******************************************************************************/
#pragma once #pragma once
......
...@@ -102,9 +102,7 @@ protected: ...@@ -102,9 +102,7 @@ protected:
/// Creates a new actor instance. /// Creates a new actor instance.
explicit monitorable_actor(actor_config& cfg); explicit monitorable_actor(actor_config& cfg);
/**************************************************************************** // -- here be dragons: end of public interface -------------------------------
* here be dragons: end of public interface *
****************************************************************************/
// precondition: `mtx_` is acquired // precondition: `mtx_` is acquired
void attach_impl(attachable_ptr& ptr) { void attach_impl(attachable_ptr& ptr) {
......
...@@ -5,34 +5,32 @@ ...@@ -5,34 +5,32 @@
// Based on work of others. Retrieved on 2020-07-01 from // Based on work of others. Retrieved on 2020-07-01 from
// https://github.com/Genivia/ugrep/blob/d2fb133/src/glob.cpp. // https://github.com/Genivia/ugrep/blob/d2fb133/src/glob.cpp.
// Original header / license: // Original header / license:
//
/******************************************************************************\ // Copyright (c) 2019, Robert van Engelen, Genivia Inc. All rights reserved.
* Copyright (c) 2019, Robert van Engelen, Genivia Inc. All rights reserved. * //
* * // Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without * // modification, are permitted provided that the following conditions are met:
* modification, are permitted provided that the following conditions are met: * //
* * // (1) Redistributions of source code must retain the above copyright notice,
* (1) Redistributions of source code must retain the above copyright notice, * // this list of conditions and the following disclaimer.
* this list of conditions and the following disclaimer. * //
* * // (2) Redistributions in binary form must reproduce the above copyright
* (2) Redistributions in binary form must reproduce the above copyright * // notice, this list of conditions and the following disclaimer in the
* notice, this list of conditions and the following disclaimer in the * // documentation and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution. * //
* * // (3) The name of the author may not be used to endorse or promote products
* (3) The name of the author may not be used to endorse or promote products * // derived from this software without specific prior written permission.
* derived from this software without specific prior written permission. * //
* * // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED * // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO * // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
\******************************************************************************/
#include "caf/detail/glob_match.hpp" #include "caf/detail/glob_match.hpp"
......
/****************************************************************************** // This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
* ____ _ _____ * // the main distribution directory for license terms and copyright or visit
* / ___| / \ | ___| C++ * // https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2021 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#include "caf/detail/private_thread_pool.hpp" #include "caf/detail/private_thread_pool.hpp"
......
...@@ -2,43 +2,40 @@ ...@@ -2,43 +2,40 @@
// the main distribution directory for license terms and copyright or visit // the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE. // https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
/******************************************************************************\ // Based on http://homes.esat.kuleuven.be/~cosicart/ps/AB-9601/rmd160.c;
* Based on http://homes.esat.kuleuven.be/~cosicart/ps/AB-9601/rmd160.c; * // original header:
* original header: * //
* * // AUTHOR: Antoon Bosselaers, ESAT-COSIC
* AUTHOR: Antoon Bosselaers, ESAT-COSIC * // DATE: 1 March 1996
* DATE: 1 March 1996 * // VERSION: 1.0
* VERSION: 1.0 * //
* * // Copyright (c) Katholieke Universiteit Leuven
* Copyright (c) Katholieke Universiteit Leuven * // 1996, All Rights Reserved
* 1996, All Rights Reserved * //
* * // Conditions for use of the RIPEMD-160 Software
* Conditions for use of the RIPEMD-160 Software * //
* * // The RIPEMD-160 software is freely available for use under the terms and
* The RIPEMD-160 software is freely available for use under the terms and * // conditions described hereunder, which shall be deemed to be accepted by
* conditions described hereunder, which shall be deemed to be accepted by * // any user of the software and applicable on any use of the software:
* any user of the software and applicable on any use of the software: * //
* * // 1. K.U.Leuven Department of Electrical Engineering-ESAT/COSIC shall for
* 1. K.U.Leuven Department of Electrical Engineering-ESAT/COSIC shall for * // all purposes be considered the owner of the RIPEMD-160 software and of
* all purposes be considered the owner of the RIPEMD-160 software and of * // all copyright, trade secret, patent or other intellectual property
* all copyright, trade secret, patent or other intellectual property * // rights therein.
* rights therein. * // 2. The RIPEMD-160 software is provided on an "as is" basis without
* 2. The RIPEMD-160 software is provided on an "as is" basis without * // warranty of any sort, express or implied. K.U.Leuven makes no
* warranty of any sort, express or implied. K.U.Leuven makes no * // representation that the use of the software will not infringe any
* representation that the use of the software will not infringe any * // patent or proprietary right of third parties. User will indemnify
* patent or proprietary right of third parties. User will indemnify * // K.U.Leuven and hold K.U.Leuven harmless from any claims or liabilities
* K.U.Leuven and hold K.U.Leuven harmless from any claims or liabilities * // which may arise as a result of its use of the software. In no
* which may arise as a result of its use of the software. In no * // circumstances K.U.Leuven R&D will be held liable for any deficiency,
* circumstances K.U.Leuven R&D will be held liable for any deficiency, * // fault or other mishappening with regard to the use or performance of
* fault or other mishappening with regard to the use or performance of * // the software.
* the software. * // 3. User agrees to give due credit to K.U.Leuven in scientific
* 3. User agrees to give due credit to K.U.Leuven in scientific * // publications or communications in relation with the use of the
* publications or communications in relation with the use of the * // RIPEMD-160 software as follows: RIPEMD-160 software written by
* RIPEMD-160 software as follows: RIPEMD-160 software written by * // Antoon Bosselaers,
* Antoon Bosselaers, * // available at http://www.esat.kuleuven.be/~cosicart/ps/AB-9601/.
* available at http://www.esat.kuleuven.be/~cosicart/ps/AB-9601/. *
* *
\******************************************************************************/
#include "caf/detail/ripemd_160.hpp" #include "caf/detail/ripemd_160.hpp"
#include <cstring> #include <cstring>
......
...@@ -31,9 +31,7 @@ ...@@ -31,9 +31,7 @@
namespace caf::scheduler { namespace caf::scheduler {
/****************************************************************************** // -- utility and implementation details ---------------------------------------
* utility and implementation details *
******************************************************************************/
namespace { namespace {
...@@ -164,9 +162,7 @@ public: ...@@ -164,9 +162,7 @@ public:
} // namespace } // namespace
/****************************************************************************** // -- implementation of coordinator --------------------------------------------
* implementation of coordinator *
******************************************************************************/
const actor_system_config& abstract_coordinator::config() const { const actor_system_config& abstract_coordinator::config() const {
return system_.config(); return system_.config();
......
/****************************************************************************** // This file is part of CAF, the C++ Actor Framework. See the file LICENSE in
* ____ _ _____ * // the main distribution directory for license terms and copyright or visit
* / ___| / \ | ___| C++ * // https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2021 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#define CAF_SUITE detail.private_thread_pool #define CAF_SUITE detail.private_thread_pool
......
...@@ -42,9 +42,7 @@ static_assert(std::is_convertible<dummy5, dummy3>::value, ...@@ -42,9 +42,7 @@ static_assert(std::is_convertible<dummy5, dummy3>::value,
static_assert(std::is_convertible<dummy5, dummy4>::value, static_assert(std::is_convertible<dummy5, dummy4>::value,
"handle not assignable to narrower definition"); "handle not assignable to narrower definition");
/****************************************************************************** // -- simple request/response test ---------------------------------------------
* simple request/response test *
******************************************************************************/
using server_type = typed_actor<result<bool>(my_request)>; using server_type = typed_actor<result<bool>(my_request)>;
...@@ -81,9 +79,7 @@ void client(event_based_actor* self, const actor& parent, ...@@ -81,9 +79,7 @@ void client(event_based_actor* self, const actor& parent,
}); });
} }
/****************************************************************************** // -- test skipping of messages intentionally + using become() -----------------
* test skipping of messages intentionally + using become() *
******************************************************************************/
using event_testee_type using event_testee_type
= typed_actor<result<string>(get_state_atom), result<void>(string), = typed_actor<result<string>(get_state_atom), result<void>(string),
...@@ -127,9 +123,7 @@ public: ...@@ -127,9 +123,7 @@ public:
} }
}; };
/****************************************************************************** // -- simple 'forwarding' chain ------------------------------------------------
* simple 'forwarding' chain *
******************************************************************************/
using string_actor = typed_actor<result<string>(string)>; using string_actor = typed_actor<result<string>(string)>;
...@@ -178,9 +172,7 @@ maybe_string_delegator(maybe_string_actor::pointer self, ...@@ -178,9 +172,7 @@ maybe_string_delegator(maybe_string_actor::pointer self,
}; };
} }
/****************************************************************************** // -- sending typed actor handles ----------------------------------------------
* sending typed actor handles *
******************************************************************************/
int_actor::behavior_type int_fun() { int_actor::behavior_type int_fun() {
return { return {
...@@ -256,9 +248,7 @@ struct fixture : test_coordinator_fixture<> { ...@@ -256,9 +248,7 @@ struct fixture : test_coordinator_fixture<> {
BEGIN_FIXTURE_SCOPE(fixture) BEGIN_FIXTURE_SCOPE(fixture)
/****************************************************************************** // -- putting it all together --------------------------------------------------
* put it all together *
******************************************************************************/
CAF_TEST(typed_spawns) { CAF_TEST(typed_spawns) {
MESSAGE("run test series with typed_server1"); MESSAGE("run test series with typed_server1");
......
...@@ -252,37 +252,35 @@ expected<void> allow_udp_connreset(native_socket fd, bool new_value) { ...@@ -252,37 +252,35 @@ expected<void> allow_udp_connreset(native_socket fd, bool new_value) {
return unit; return unit;
} }
/**************************************************************************\ // Based on work of others;
* Based on work of others; * // original header:
* original header: * //
* * // Copyright 2007, 2010 by Nathan C. Myers <ncm@cantrip.org>
* Copyright 2007, 2010 by Nathan C. Myers <ncm@cantrip.org> * // Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without * // modification, are permitted provided that the following conditions
* modification, are permitted provided that the following conditions * // are met:
* are met: * //
* * // Redistributions of source code must retain the above copyright notice,
* Redistributions of source code must retain the above copyright notice, * // this list of conditions and the following disclaimer.
* this list of conditions and the following disclaimer. * //
* * // Redistributions in binary form must reproduce the above copyright
* Redistributions in binary form must reproduce the above copyright * // notice, this list of conditions and the following disclaimer in the
* notice, this list of conditions and the following disclaimer in the * // documentation and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution. * //
* * // The name of the author must not be used to endorse or promote products
* The name of the author must not be used to endorse or promote products * // derived from this software without specific prior written permission.
* derived from this software without specific prior written permission. * //
* * // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
\**************************************************************************/
std::pair<native_socket, native_socket> create_pipe() { std::pair<native_socket, native_socket> create_pipe() {
socket_size_type addrlen = sizeof(sockaddr_in); socket_size_type addrlen = sizeof(sockaddr_in);
native_socket socks[2] = {invalid_native_socket, invalid_native_socket}; native_socket socks[2] = {invalid_native_socket, invalid_native_socket};
......
...@@ -25,37 +25,35 @@ namespace caf::net { ...@@ -25,37 +25,35 @@ namespace caf::net {
constexpr int no_sigpipe_io_flag = 0; constexpr int no_sigpipe_io_flag = 0;
/**************************************************************************\ // Based on work of others;
* Based on work of others; * // original header:
* original header: * //
* * // Copyright 2007, 2010 by Nathan C. Myers <ncm@cantrip.org>
* Copyright 2007, 2010 by Nathan C. Myers <ncm@cantrip.org> * // Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without * // modification, are permitted provided that the following conditions
* modification, are permitted provided that the following conditions * // are met:
* are met: * //
* * // Redistributions of source code must retain the above copyright notice,
* Redistributions of source code must retain the above copyright notice, * // this list of conditions and the following disclaimer.
* this list of conditions and the following disclaimer. * //
* * // Redistributions in binary form must reproduce the above copyright
* Redistributions in binary form must reproduce the above copyright * // notice, this list of conditions and the following disclaimer in the
* notice, this list of conditions and the following disclaimer in the * // documentation and/or other materials provided with the distribution.
* documentation and/or other materials provided with the distribution. * //
* * // The name of the author must not be used to endorse or promote products
* The name of the author must not be used to endorse or promote products * // derived from this software without specific prior written permission.
* derived from this software without specific prior written permission. * //
* * // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
\**************************************************************************/
expected<std::pair<stream_socket, stream_socket>> make_stream_socket_pair() { expected<std::pair<stream_socket, stream_socket>> make_stream_socket_pair() {
auto addrlen = static_cast<int>(sizeof(sockaddr_in)); auto addrlen = static_cast<int>(sizeof(sockaddr_in));
socket_id socks[2] = {invalid_socket_id, invalid_socket_id}; socket_id socks[2] = {invalid_socket_id, invalid_socket_id};
......
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