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 *
* exercise using only libcaf's event-based actor implementation. *
\******************************************************************************/
// This example is an implementation of the classical Dining Philosophers
// exercise using only CAF's event-based actor implementation.
#include <chrono>
#include <iostream>
......
/******************************************************************************\
* This example is a very basic, non-interactive math service implemented *
* for both the blocking and the event-based API. *
\******************************************************************************/
// This example is a very basic, non-interactive math service implemented for
// both the blocking and the event-based API.
#include <iostream>
......
/******************************************************************************\
* This example is a very basic, non-interactive math service implemented *
* for both the blocking and the event-based API. *
\******************************************************************************/
// This example is a very basic, non-interactive math service implemented for
// both the blocking and the event-based API.
#include <cstdint>
#include <iostream>
......
/******************************************************************************\
* This example illustrates how to do time-triggered loops in libcaf. *
\******************************************************************************/
// This example illustrates how to do time-triggered loops in CAF.
#include <algorithm>
#include <chrono>
......
/******************************************************************************\
* A very basic, interactive divider. *
\******************************************************************************/
// A very basic, interactive divider.
#include <iostream>
......
/******************************************************************************\
* Illustrates semantics of request().{then|await|receive}. *
\******************************************************************************/
// This example illustrates semantics of request().{then|await|receive}.
#include <chrono>
#include <cstdint>
......
/******************************************************************************\
* This example is a very basic, non-interactive math service implemented *
* using typed actors. *
\******************************************************************************/
// This example is a very basic, non-interactive math service implemented using
// typed actors.
#include "caf/all.hpp"
#include <cassert>
......
/******************************************************************************\
* This example program represents a minimal GUI chat program *
* based on group communication. This chat program is compatible to the *
* terminal version in length_prefix_framing/chat-server.cpp. *
* *
* Setup for a minimal chat between "alice" and "bob": *
* - chat-server -p 4242 *
* - qt_group_chat -H localhost -p 4242 -n alice *
* - qt_group_chat -H localhost -p 4242 -n bob *
\******************************************************************************/
// This example program represents a minimal GUI chat program based on group
// communication. This chat program is compatible to the terminal version in
// length_prefix_framing/chat-server.cpp.
//
// Setup for a minimal chat between "alice" and "bob":
// - chat-server -p 4242
// - qt_group_chat -H localhost -p 4242 -n alice
// - qt_group_chat -H localhost -p 4242 -n bob
#include <cstdlib>
#include <iostream>
......
/******************************************************************************\
* This program is a distributed version of the math_actor example. *
* Client and server use a stateless request/response protocol and the client *
* is failure resilient by using a FIFO request queue. *
* The client auto-reconnects and also allows for server reconfiguration. *
* *
* Run server at port 4242: *
* - distributed_calculator -s -p 4242 *
* *
* Run client at the same host: *
* - distributed_calculator -c -p 4242 *
\******************************************************************************/
// This program is a distributed version of the math_actor example. Client and
// server use a stateless request/response protocol and the client is failure
// resilient by using a FIFO request queue. The client auto-reconnects and also
// allows for server reconfiguration.
//
// Run server at port 4242:
// - distributed_calculator -s -p 4242
//
// Run client at the same host:
// - distributed_calculator -c -p 4242
#include <array>
#include <cassert>
......
......@@ -97,9 +97,7 @@ public:
/// Returns the system that created this actor (or proxy).
actor_system& home_system() const noexcept;
/****************************************************************************
* here be dragons: end of public interface *
****************************************************************************/
// -- here be dragons: end of public interface -------------------------------
/// @cond PRIVATE
......
......@@ -135,6 +135,33 @@
/// @namespace caf::policy
/// 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
/// Contains all IO-related classes and functions.
///
......
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ 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. *
******************************************************************************/
// 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
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
......
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ 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. *
******************************************************************************/
// 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
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#pragma once
......
......@@ -2,41 +2,39 @@
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
/******************************************************************************\
* Based on http://homes.esat.kuleuven.be/~cosicart/ps/AB-9601/rmd160.h;
* original header:
*
* AUTHOR: Antoon Bosselaers, ESAT-COSIC
* DATE: 1 March 1996
* VERSION: 1.0
*
* Copyright (c) Katholieke Universiteit Leuven
* 1996, All Rights Reserved
*
* Conditions for use of the RIPEMD-160 Software
*
* The RIPEMD-160 software is freely available for use under the terms and
* conditions described hereunder, which shall be deemed to be accepted by
* 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
* all purposes be considered the owner of the RIPEMD-160 software and of
* all copyright, trade secret, patent or other intellectual property
* rights therein.
* 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
* representation that the use of the software will not infringe any
* patent or proprietary right of third parties. User will indemnify
* 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
* 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
* the software.
* 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
* as follows: RIPEMD-160 software written by Antoon Bosselaers,
* available at http://www.esat.kuleuven.be/~cosicart/ps/AB-9601/.
\******************************************************************************/
// Based on http://homes.esat.kuleuven.be/~cosicart/ps/AB-9601/rmd160.h;
// original header:
//
// AUTHOR: Antoon Bosselaers, ESAT-COSIC
// DATE: 1 March 1996
// VERSION: 1.0
//
// Copyright (c) Katholieke Universiteit Leuven
// 1996, All Rights Reserved
//
// Conditions for use of the RIPEMD-160 Software
//
// The RIPEMD-160 software is freely available for use under the terms and
// conditions described hereunder, which shall be deemed to be accepted by
// 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
// all purposes be considered the owner of the RIPEMD-160 software and of
// all copyright, trade secret, patent or other intellectual property
// rights therein.
// 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
// representation that the use of the software will not infringe any
// patent or proprietary right of third parties. User will indemnify
// 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
// 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
// the software.
// 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
// as follows: RIPEMD-160 software written by Antoon Bosselaers,
// available at http://www.esat.kuleuven.be/~cosicart/ps/AB-9601/.
#pragma once
......
......@@ -102,9 +102,7 @@ protected:
/// Creates a new actor instance.
explicit monitorable_actor(actor_config& cfg);
/****************************************************************************
* here be dragons: end of public interface *
****************************************************************************/
// -- here be dragons: end of public interface -------------------------------
// precondition: `mtx_` is acquired
void attach_impl(attachable_ptr& ptr) {
......
......@@ -5,34 +5,32 @@
// Based on work of others. Retrieved on 2020-07-01 from
// https://github.com/Genivia/ugrep/blob/d2fb133/src/glob.cpp.
// Original header / license:
/******************************************************************************\
* Copyright (c) 2019, Robert van Engelen, Genivia Inc. All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions are met: *
* *
* (1) Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* (2) Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* (3) The name of the author may not be used to endorse or promote products *
* derived from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED *
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO *
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, *
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR *
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF *
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
\******************************************************************************/
//
// Copyright (c) 2019, Robert van Engelen, Genivia Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// (1) Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// (2) Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// (3) The name of the author may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "caf/detail/glob_match.hpp"
......
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ 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. *
******************************************************************************/
// 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
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#include "caf/detail/private_thread_pool.hpp"
......
......@@ -2,43 +2,40 @@
// the main distribution directory for license terms and copyright or visit
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
/******************************************************************************\
* Based on http://homes.esat.kuleuven.be/~cosicart/ps/AB-9601/rmd160.c; *
* original header: *
* *
* AUTHOR: Antoon Bosselaers, ESAT-COSIC *
* DATE: 1 March 1996 *
* VERSION: 1.0 *
* *
* Copyright (c) Katholieke Universiteit Leuven *
* 1996, All Rights Reserved *
* *
* Conditions for use of the RIPEMD-160 Software *
* *
* The RIPEMD-160 software is freely available for use under the terms and *
* conditions described hereunder, which shall be deemed to be accepted by *
* 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 *
* all purposes be considered the owner of the RIPEMD-160 software and of *
* all copyright, trade secret, patent or other intellectual property *
* rights therein. *
* 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 *
* representation that the use of the software will not infringe any *
* patent or proprietary right of third parties. User will indemnify *
* 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 *
* 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 *
* the software. *
* 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 as follows: RIPEMD-160 software written by *
* Antoon Bosselaers, *
* available at http://www.esat.kuleuven.be/~cosicart/ps/AB-9601/. *
* *
\******************************************************************************/
// Based on http://homes.esat.kuleuven.be/~cosicart/ps/AB-9601/rmd160.c;
// original header:
//
// AUTHOR: Antoon Bosselaers, ESAT-COSIC
// DATE: 1 March 1996
// VERSION: 1.0
//
// Copyright (c) Katholieke Universiteit Leuven
// 1996, All Rights Reserved
//
// Conditions for use of the RIPEMD-160 Software
//
// The RIPEMD-160 software is freely available for use under the terms and
// conditions described hereunder, which shall be deemed to be accepted by
// 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
// all purposes be considered the owner of the RIPEMD-160 software and of
// all copyright, trade secret, patent or other intellectual property
// rights therein.
// 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
// representation that the use of the software will not infringe any
// patent or proprietary right of third parties. User will indemnify
// 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
// 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
// the software.
// 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 as follows: RIPEMD-160 software written by
// Antoon Bosselaers,
// available at http://www.esat.kuleuven.be/~cosicart/ps/AB-9601/.
#include "caf/detail/ripemd_160.hpp"
#include <cstring>
......
......@@ -31,9 +31,7 @@
namespace caf::scheduler {
/******************************************************************************
* utility and implementation details *
******************************************************************************/
// -- utility and implementation details ---------------------------------------
namespace {
......@@ -164,9 +162,7 @@ public:
} // namespace
/******************************************************************************
* implementation of coordinator *
******************************************************************************/
// -- implementation of coordinator --------------------------------------------
const actor_system_config& abstract_coordinator::config() const {
return system_.config();
......
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ 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. *
******************************************************************************/
// 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
// https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
#define CAF_SUITE detail.private_thread_pool
......
......@@ -42,9 +42,7 @@ static_assert(std::is_convertible<dummy5, dummy3>::value,
static_assert(std::is_convertible<dummy5, dummy4>::value,
"handle not assignable to narrower definition");
/******************************************************************************
* simple request/response test *
******************************************************************************/
// -- simple request/response test ---------------------------------------------
using server_type = typed_actor<result<bool>(my_request)>;
......@@ -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
= typed_actor<result<string>(get_state_atom), result<void>(string),
......@@ -127,9 +123,7 @@ public:
}
};
/******************************************************************************
* simple 'forwarding' chain *
******************************************************************************/
// -- simple 'forwarding' chain ------------------------------------------------
using string_actor = typed_actor<result<string>(string)>;
......@@ -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() {
return {
......@@ -256,9 +248,7 @@ struct fixture : test_coordinator_fixture<> {
BEGIN_FIXTURE_SCOPE(fixture)
/******************************************************************************
* put it all together *
******************************************************************************/
// -- putting it all together --------------------------------------------------
CAF_TEST(typed_spawns) {
MESSAGE("run test series with typed_server1");
......
......@@ -252,37 +252,35 @@ expected<void> allow_udp_connreset(native_socket fd, bool new_value) {
return unit;
}
/**************************************************************************\
* Based on work of others; *
* original header: *
* *
* Copyright 2007, 2010 by Nathan C. Myers <ncm@cantrip.org> *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* The name of the author must not be used to endorse or promote products *
* derived from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
\**************************************************************************/
// Based on work of others;
// original header:
//
// Copyright 2007, 2010 by Nathan C. Myers <ncm@cantrip.org>
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// The name of the author must not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
std::pair<native_socket, native_socket> create_pipe() {
socket_size_type addrlen = sizeof(sockaddr_in);
native_socket socks[2] = {invalid_native_socket, invalid_native_socket};
......
......@@ -25,37 +25,35 @@ namespace caf::net {
constexpr int no_sigpipe_io_flag = 0;
/**************************************************************************\
* Based on work of others; *
* original header: *
* *
* Copyright 2007, 2010 by Nathan C. Myers <ncm@cantrip.org> *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* The name of the author must not be used to endorse or promote products *
* derived from this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
\**************************************************************************/
// Based on work of others;
// original header:
//
// Copyright 2007, 2010 by Nathan C. Myers <ncm@cantrip.org>
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// The name of the author must not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
expected<std::pair<stream_socket, stream_socket>> make_stream_socket_pair() {
auto addrlen = static_cast<int>(sizeof(sockaddr_in));
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