...
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -72,3 +72,4 @@ CMakeLists.txt.user*
|
|||||||
*.dll
|
*.dll
|
||||||
*.exe
|
*.exe
|
||||||
|
|
||||||
|
build/
|
||||||
|
|||||||
115
CMakeLists.txt
115
CMakeLists.txt
@@ -4,7 +4,7 @@ project(ADC LANGUAGES CXX)
|
|||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
# set(CMAKE_BUILD_TYPE Release)
|
# set(CMAKE_BUILD_TYPE Release)
|
||||||
|
|
||||||
@@ -28,11 +28,10 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|||||||
# message(WARNING "You are using an unsupported compiler! Compilation has only been tested with Clang and GCC.")
|
# message(WARNING "You are using an unsupported compiler! Compilation has only been tested with Clang and GCC.")
|
||||||
# endif()
|
# endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
set(ADC_COMMON_HEADERS
|
set(ADC_COMMON_HEADERS
|
||||||
common/adc_traits.h
|
common/adc_traits.h
|
||||||
common/adc_utils.h
|
common/adc_utils.h
|
||||||
|
common/adc_serialization.h
|
||||||
# common/adc_value_holder.h
|
# common/adc_value_holder.h
|
||||||
# common/adc_value.h
|
# common/adc_value.h
|
||||||
# common/adc_valholder.h
|
# common/adc_valholder.h
|
||||||
@@ -45,7 +44,6 @@ set(ADC_DEVICE_HEADERS
|
|||||||
device/adc_device_concepts.h
|
device/adc_device_concepts.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
set(ADC_NETWORK_HEADERS
|
set(ADC_NETWORK_HEADERS
|
||||||
# net/adc_netmsg.h
|
# net/adc_netmsg.h
|
||||||
# net/adc_netmessage.h
|
# net/adc_netmessage.h
|
||||||
@@ -60,76 +58,82 @@ set(ADC_NETWORK_HEADERS
|
|||||||
net/adc_device_netclient.h
|
net/adc_device_netclient.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
option(ASIO_LIBRARY "Use of ASIO library for networking implementation" ON)
|
option(ASIO_LIBRARY "Use of ASIO library for networking implementation" ON)
|
||||||
|
|
||||||
if (ASIO_LIBRARY)
|
if(ASIO_LIBRARY)
|
||||||
find_package(ASIO REQUIRED)
|
find_package(ASIO REQUIRED)
|
||||||
|
|
||||||
set(ADC_NETWORK_HEADERS ${ADC_NETWORK_HEADERS}
|
set(ADC_NETWORK_HEADERS
|
||||||
|
${ADC_NETWORK_HEADERS}
|
||||||
net/asio/adc_netservice_asio.h
|
net/asio/adc_netservice_asio.h
|
||||||
net/asio/adc_device_netserver_asio.h
|
net/asio/adc_device_netserver_asio.h
|
||||||
)
|
)
|
||||||
|
|
||||||
add_compile_definitions(PUBLIC USE_ASIO_LIBRARY)
|
add_compile_definitions(PUBLIC USE_ASIO_LIBRARY)
|
||||||
|
|
||||||
option(OPENSSL_LIBRARY "Use openssl library for related ASIO-based implementation" ON)
|
option(
|
||||||
if (OPENSSL_LIBRARY)
|
OPENSSL_LIBRARY
|
||||||
|
"Use openssl library for related ASIO-based implementation"
|
||||||
|
ON
|
||||||
|
)
|
||||||
|
if(OPENSSL_LIBRARY)
|
||||||
find_package(OpenSSL REQUIRED)
|
find_package(OpenSSL REQUIRED)
|
||||||
add_compile_definitions(PUBLIC USE_OPENSSL_WITH_ASIO)
|
add_compile_definitions(PUBLIC USE_OPENSSL_WITH_ASIO)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
option(SPDLOG_LIBRARY "Use of SPDLOG library for logging" ON)
|
option(SPDLOG_LIBRARY "Use of SPDLOG library for logging" ON)
|
||||||
|
|
||||||
if (SPDLOG_LIBRARY)
|
if(SPDLOG_LIBRARY)
|
||||||
find_package(spdlog REQUIRED)
|
find_package(spdlog REQUIRED)
|
||||||
find_package(fmt REQUIRED)
|
find_package(fmt REQUIRED)
|
||||||
|
|
||||||
set(ADC_COMMON_HEADERS ${ADC_COMMON_HEADERS}
|
set(ADC_COMMON_HEADERS ${ADC_COMMON_HEADERS} common/adc_spdlog.h)
|
||||||
common/adc_spdlog.h
|
|
||||||
)
|
|
||||||
|
|
||||||
set(ADC_NETWORK_HEADERS ${ADC_NETWORK_HEADERS}
|
set(ADC_NETWORK_HEADERS ${ADC_NETWORK_HEADERS} net/adc_netserver_spdlog.h)
|
||||||
net/adc_netserver_spdlog.h
|
|
||||||
)
|
|
||||||
|
|
||||||
add_compile_definitions(PUBLIC USE_SPDLOG_LIBRARY)
|
add_compile_definitions(PUBLIC USE_SPDLOG_LIBRARY)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
option(
|
||||||
|
USE_UWEBSOCKET
|
||||||
|
"Use of uWebsocket library for websocket-related staff"
|
||||||
|
ON
|
||||||
|
)
|
||||||
|
|
||||||
|
if(USE_UWEBSOCKET)
|
||||||
option(USE_UWEBSOCKET "Use of uWebsocket library for websocket-related staff" ON)
|
|
||||||
|
|
||||||
if (USE_UWEBSOCKET)
|
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
|
|
||||||
FetchContent_Declare(uwebsockets
|
FetchContent_Declare(
|
||||||
SOURCE_DIR ${CMAKE_BINARY_DIR}/uWebsockets
|
uwebsockets
|
||||||
BINARY_DIR ${CMAKE_BINARY_DIR}
|
SOURCE_DIR
|
||||||
|
${CMAKE_BINARY_DIR}/uWebsockets
|
||||||
|
BINARY_DIR
|
||||||
|
${CMAKE_BINARY_DIR}
|
||||||
GIT_REPOSITORY "https://github.com/uNetworking/uWebSockets.git"
|
GIT_REPOSITORY "https://github.com/uNetworking/uWebSockets.git"
|
||||||
GIT_TAG "v20.67.0"
|
GIT_TAG "v20.67.0"
|
||||||
GIT_SHALLOW TRUE
|
GIT_SHALLOW TRUE
|
||||||
GIT_SUBMODULES ""
|
GIT_SUBMODULES ""
|
||||||
GIT_PROGRESS TRUE
|
GIT_PROGRESS TRUE
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(uwebsockets)
|
FetchContent_MakeAvailable(uwebsockets)
|
||||||
FetchContent_GetProperties(uwebsockets SOURCE_DIR uwebsockets_SOURCE_DIR)
|
FetchContent_GetProperties(uwebsockets SOURCE_DIR uwebsockets_SOURCE_DIR)
|
||||||
|
|
||||||
set(UWEBSOCKETS_INCLUDE_DIR ${uwebsockets_SOURCE_DIR}/src)
|
set(UWEBSOCKETS_INCLUDE_DIR ${uwebsockets_SOURCE_DIR}/src)
|
||||||
|
|
||||||
FetchContent_Declare(usockets
|
FetchContent_Declare(
|
||||||
SOURCE_DIR ${uwebsockets_SOURCE_DIR}/uSockets
|
usockets
|
||||||
BINARY_DIR ${CMAKE_BINARY_DIR}
|
SOURCE_DIR
|
||||||
|
${uwebsockets_SOURCE_DIR}/uSockets
|
||||||
|
BINARY_DIR
|
||||||
|
${CMAKE_BINARY_DIR}
|
||||||
GIT_REPOSITORY "https://github.com/uNetworking/uSockets.git"
|
GIT_REPOSITORY "https://github.com/uNetworking/uSockets.git"
|
||||||
GIT_TAG "v0.8.8"
|
GIT_TAG "v0.8.8"
|
||||||
GIT_SHALLOW TRUE
|
GIT_SHALLOW TRUE
|
||||||
GIT_SUBMODULES ""
|
GIT_SUBMODULES ""
|
||||||
GIT_PROGRESS TRUE
|
GIT_PROGRESS TRUE
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(usockets)
|
FetchContent_MakeAvailable(usockets)
|
||||||
FetchContent_GetProperties(usockets SOURCE_DIR usockets_SOURCE_DIR)
|
FetchContent_GetProperties(usockets SOURCE_DIR usockets_SOURCE_DIR)
|
||||||
|
|
||||||
@@ -137,7 +141,8 @@ if (USE_UWEBSOCKET)
|
|||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
|
|
||||||
ExternalProject_Add(LIBUS
|
ExternalProject_Add(
|
||||||
|
LIBUS
|
||||||
SOURCE_DIR ${usockets_SOURCE_DIR}
|
SOURCE_DIR ${usockets_SOURCE_DIR}
|
||||||
PREFIX ${CMAKE_BINARY_DIR}/_deps
|
PREFIX ${CMAKE_BINARY_DIR}/_deps
|
||||||
BUILD_IN_SOURCE TRUE
|
BUILD_IN_SOURCE TRUE
|
||||||
@@ -148,17 +153,19 @@ if (USE_UWEBSOCKET)
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_library(LIBUS_LIB STATIC IMPORTED)
|
add_library(LIBUS_LIB STATIC IMPORTED)
|
||||||
set_target_properties(LIBUS_LIB PROPERTIES IMPORTED_LOCATION ${usockets_SOURCE_DIR}/uSockets.a)
|
set_target_properties(
|
||||||
|
LIBUS_LIB
|
||||||
|
PROPERTIES IMPORTED_LOCATION ${usockets_SOURCE_DIR}/uSockets.a
|
||||||
|
)
|
||||||
get_target_property(LIBUS_LIB_PATH LIBUS_LIB IMPORTED_LOCATION)
|
get_target_property(LIBUS_LIB_PATH LIBUS_LIB IMPORTED_LOCATION)
|
||||||
|
|
||||||
include_directories(${USOCKETS_INCLUDE_DIR})
|
include_directories(${USOCKETS_INCLUDE_DIR})
|
||||||
include_directories(${UWEBSOCKETS_INCLUDE_DIR})
|
include_directories(${UWEBSOCKETS_INCLUDE_DIR})
|
||||||
|
|
||||||
endif(USE_UWEBSOCKET)
|
endif(USE_UWEBSOCKET)
|
||||||
|
|
||||||
option(BUILD_TESTS "Build tests" ON)
|
option(BUILD_TESTS "Build tests" ON)
|
||||||
|
|
||||||
if (BUILD_TESTS)
|
if(BUILD_TESTS)
|
||||||
find_package(doctest)
|
find_package(doctest)
|
||||||
|
|
||||||
# set(VALUEHOLDER_TEST_APP adc_valueholder_test)
|
# set(VALUEHOLDER_TEST_APP adc_valueholder_test)
|
||||||
@@ -175,21 +182,34 @@ if (BUILD_TESTS)
|
|||||||
|
|
||||||
set(NETSERVICE_TEST_APP adc_netservice_test)
|
set(NETSERVICE_TEST_APP adc_netservice_test)
|
||||||
add_executable(${NETSERVICE_TEST_APP} tests/adc_netservice_test.cpp)
|
add_executable(${NETSERVICE_TEST_APP} tests/adc_netservice_test.cpp)
|
||||||
if (OPENSSL_LIBRARY)
|
if(OPENSSL_LIBRARY)
|
||||||
target_link_libraries(${NETSERVICE_TEST_APP} OpenSSL::SSL OpenSSL::Crypto)
|
target_link_libraries(
|
||||||
|
${NETSERVICE_TEST_APP}
|
||||||
|
OpenSSL::SSL
|
||||||
|
OpenSSL::Crypto
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ASIO_LIBRARY)
|
if(ASIO_LIBRARY)
|
||||||
find_package(cxxopts CONFIG)
|
find_package(cxxopts CONFIG)
|
||||||
set(ASIO_NETSERVER_TEST_APP adc_asio_netserver_test)
|
set(ASIO_NETSERVER_TEST_APP adc_asio_netserver_test)
|
||||||
add_executable(${ASIO_NETSERVER_TEST_APP} tests/adc_asio_netserver_test.cpp)
|
add_executable(
|
||||||
target_link_libraries(${ASIO_NETSERVER_TEST_APP} PUBLIC Threads::Threads cxxopts::cxxopts)
|
${ASIO_NETSERVER_TEST_APP}
|
||||||
if (OPENSSL_LIBRARY)
|
tests/adc_asio_netserver_test.cpp
|
||||||
target_link_libraries(${ASIO_NETSERVER_TEST_APP} PUBLIC OpenSSL::SSL OpenSSL::Crypto)
|
)
|
||||||
|
target_link_libraries(
|
||||||
|
${ASIO_NETSERVER_TEST_APP}
|
||||||
|
PUBLIC Threads::Threads cxxopts::cxxopts
|
||||||
|
)
|
||||||
|
if(OPENSSL_LIBRARY)
|
||||||
|
target_link_libraries(
|
||||||
|
${ASIO_NETSERVER_TEST_APP}
|
||||||
|
PUBLIC OpenSSL::SSL OpenSSL::Crypto
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT doctest_FOUND)
|
if(NOT doctest_FOUND)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
doctest
|
doctest
|
||||||
@@ -207,7 +227,7 @@ if (BUILD_TESTS)
|
|||||||
add_test(NETMSG_TEST ${NETMSG_TEST_APP})
|
add_test(NETMSG_TEST ${NETMSG_TEST_APP})
|
||||||
|
|
||||||
add_test(ASIO_NETSRV_TEST ${ASIO_NETSERVER_TEST_APP})
|
add_test(ASIO_NETSRV_TEST ${ASIO_NETSERVER_TEST_APP})
|
||||||
if (SPDLOG_LIBRARY)
|
if(SPDLOG_LIBRARY)
|
||||||
target_link_libraries(${ASIO_NETSERVER_TEST_APP} PRIVATE fmt::fmt)
|
target_link_libraries(${ASIO_NETSERVER_TEST_APP} PRIVATE fmt::fmt)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -216,7 +236,13 @@ endif(BUILD_TESTS)
|
|||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} INTERFACE ${ADC_COMMON_HEADERS} ${ADC_DEVICE_HEADERS} ${ADC_NETWORK_HEADERS})
|
add_library(
|
||||||
|
${PROJECT_NAME}
|
||||||
|
INTERFACE
|
||||||
|
${ADC_COMMON_HEADERS}
|
||||||
|
${ADC_DEVICE_HEADERS}
|
||||||
|
${ADC_NETWORK_HEADERS}
|
||||||
|
)
|
||||||
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_20)
|
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_20)
|
||||||
# target_link_libraries(${PROJECT_NAME} INTERFACE ASIO::ASIO)
|
# target_link_libraries(${PROJECT_NAME} INTERFACE ASIO::ASIO)
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
@@ -225,4 +251,3 @@ target_include_directories(
|
|||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
$<INSTALL_INTERFACE:include>
|
$<INSTALL_INTERFACE:include>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
518
common/adc_serialization.h
Normal file
518
common/adc_serialization.h
Normal file
@@ -0,0 +1,518 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
ABSTRACT DEVICE COMPONENTS LIBRARY
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <concepts>
|
||||||
|
#include <ranges>
|
||||||
|
|
||||||
|
#include "adc_traits.h"
|
||||||
|
#include "adc_utils.h"
|
||||||
|
|
||||||
|
namespace adc
|
||||||
|
{
|
||||||
|
|
||||||
|
/* SERIALIZATION/DESERIALIZATION PROCESS ERROR */
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
concept adc_serialization_error_c = std::default_initializable<T> && (std::convertible_to<T, bool> || requires {
|
||||||
|
(bool)T() == false; // default constucted value must be a "non-error"!
|
||||||
|
});
|
||||||
|
|
||||||
|
// default
|
||||||
|
typedef std::error_code adc_serialization_error_t;
|
||||||
|
|
||||||
|
/* SERIALIZATION/DESERIALIZATION PROCESS TUNING PARAMETERS */
|
||||||
|
|
||||||
|
|
||||||
|
// delimiter between items of serializing values sequence
|
||||||
|
static constexpr std::string_view adc_SERIALIZING_DEFAULT_SEQ_DELIMITER{";"};
|
||||||
|
|
||||||
|
// delimiter between items of aggregative (multi-element) serializing value
|
||||||
|
static constexpr std::string_view adc_SERIALIZING_DEFAULT_ELEM_DELIMITER{","};
|
||||||
|
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
concept adc_serialization_params_c = std::copyable<T> && requires(T t) {
|
||||||
|
// delimiter between items of serializing values sequence
|
||||||
|
requires traits::adc_output_char_range<decltype(t.elem_delim)>;
|
||||||
|
|
||||||
|
// delimiter between items of aggregative (multi-element) serializing value
|
||||||
|
requires traits::adc_output_char_range<decltype(t.seq_delim)>;
|
||||||
|
|
||||||
|
// a format string for std::chrono::time_point types
|
||||||
|
requires traits::adc_output_char_range<decltype(t.timepoint_format)>;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// default serializatio/deserialization process parameters type
|
||||||
|
struct adc_serialization_params_t {
|
||||||
|
std::string elem_delim{adc_SERIALIZING_DEFAULT_ELEM_DELIMITER};
|
||||||
|
std::string seq_delim{adc_SERIALIZING_DEFAULT_SEQ_DELIMITER};
|
||||||
|
std::string timepoint_format{"{:%FT%T}"};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* SERIALIZER/DESERIALIZER CONCEPTS */
|
||||||
|
|
||||||
|
template <adc_serialization_error_c RetT>
|
||||||
|
struct adc_serializer_interface_t {
|
||||||
|
virtual ~adc_serializer_interface_t() = default;
|
||||||
|
|
||||||
|
typedef RetT error_t;
|
||||||
|
|
||||||
|
template <std::derived_from<adc_serializer_interface_t> SelfT, traits::adc_output_char_range R, typename ValueT>
|
||||||
|
RetT operator()(this SelfT&& self, R& output, ValueT const& value)
|
||||||
|
{
|
||||||
|
return std::forward<SelfT>(self)(output, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <std::derived_from<adc_serializer_interface_t> SelfT, traits::adc_output_char_range R, typename ValueT>
|
||||||
|
RetT operator()(this SelfT&& self, R& output, ValueT const& value, adc_serialization_params_c auto const& params)
|
||||||
|
{
|
||||||
|
return std::forward<SelfT>(self)(output, value, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
adc_serializer_interface_t() = default;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
concept adc_serializer_c =
|
||||||
|
std::derived_from<T, adc_serializer_interface_t<typename T::error_t>> && requires(T t, const T t_const) {
|
||||||
|
// static const variable with name of the serializer
|
||||||
|
requires std::formattable<decltype(T::serializerName), char> && std::is_const_v<decltype(T::serializerName)>;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template <adc_serialization_error_c RetT>
|
||||||
|
struct adc_deserializer_interface_t {
|
||||||
|
virtual ~adc_deserializer_interface_t() = default;
|
||||||
|
|
||||||
|
typedef RetT error_t;
|
||||||
|
|
||||||
|
template <std::derived_from<adc_deserializer_interface_t> SelfT, traits::adc_input_char_range R, typename ValueT>
|
||||||
|
RetT operator()(this SelfT&& self, R const& input, ValueT& value)
|
||||||
|
{
|
||||||
|
return std::forward<SelfT>(self)(input, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <std::derived_from<adc_deserializer_interface_t> SelfT, traits::adc_input_char_range R, typename ValueT>
|
||||||
|
RetT operator()(this SelfT&& self, R const& input, ValueT& value, adc_serialization_params_c auto& params)
|
||||||
|
{
|
||||||
|
return std::forward<SelfT>(self)(input, value, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
adc_deserializer_interface_t() = default;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
concept adc_deserializer_c =
|
||||||
|
std::derived_from<T, adc_deserializer_interface_t<typename T::error_t>> && requires(T t, const T t_const) {
|
||||||
|
// static const variable with name of the deserializer
|
||||||
|
requires std::formattable<decltype(T::deserializerName), char> &&
|
||||||
|
std::is_const_v<decltype(T::deserializerName)>;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace adc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* BASIC IMPLEMENTATION OF SERIALIZER AND DESERIALIZER CLASSES */
|
||||||
|
|
||||||
|
namespace adc
|
||||||
|
{
|
||||||
|
|
||||||
|
enum class AdcSerializerErrorCode : int { ERROR_OK, ERROR_UNDERLYING_SERIALIZER };
|
||||||
|
|
||||||
|
enum class AdcDeserializerErrorCode : int { ERROR_OK, ERROR_UNDERLYING_DESERIALIZER, ERROR_INVALID_SERIALIZED_VALUE };
|
||||||
|
|
||||||
|
} // namespace adc
|
||||||
|
|
||||||
|
|
||||||
|
namespace std
|
||||||
|
{
|
||||||
|
|
||||||
|
template <>
|
||||||
|
class is_error_code_enum<adc::AdcSerializerErrorCode> : public true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
class is_error_code_enum<adc::AdcDeserializerErrorCode> : public true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace std
|
||||||
|
|
||||||
|
|
||||||
|
namespace adc
|
||||||
|
{
|
||||||
|
|
||||||
|
// error category
|
||||||
|
struct AdcSerializerCategory : public std::error_category {
|
||||||
|
AdcSerializerCategory() : std::error_category() {}
|
||||||
|
|
||||||
|
const char* name() const noexcept
|
||||||
|
{
|
||||||
|
return "Adc-SERIALIZER-ERR-CATEGORY";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string message(int ec) const
|
||||||
|
{
|
||||||
|
AdcSerializerErrorCode err = static_cast<AdcSerializerErrorCode>(ec);
|
||||||
|
|
||||||
|
switch (err) {
|
||||||
|
case AdcSerializerErrorCode::ERROR_OK:
|
||||||
|
return "OK";
|
||||||
|
case AdcSerializerErrorCode::ERROR_UNDERLYING_SERIALIZER:
|
||||||
|
return "error returned by underlying serializer";
|
||||||
|
default:
|
||||||
|
return "UNKNOWN";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static const AdcSerializerCategory& get()
|
||||||
|
{
|
||||||
|
static const AdcSerializerCategory constInst;
|
||||||
|
return constInst;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// error category
|
||||||
|
struct AdcDeserializerCategory : public std::error_category {
|
||||||
|
AdcDeserializerCategory() : std::error_category() {}
|
||||||
|
|
||||||
|
const char* name() const noexcept
|
||||||
|
{
|
||||||
|
return "Adc-DESERIALIZER-ERR-CATEGORY";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string message(int ec) const
|
||||||
|
{
|
||||||
|
AdcDeserializerErrorCode err = static_cast<AdcDeserializerErrorCode>(ec);
|
||||||
|
|
||||||
|
switch (err) {
|
||||||
|
case AdcDeserializerErrorCode::ERROR_OK:
|
||||||
|
return "OK";
|
||||||
|
case AdcDeserializerErrorCode::ERROR_UNDERLYING_DESERIALIZER:
|
||||||
|
return "error returned by underlying deserializer";
|
||||||
|
case AdcDeserializerErrorCode::ERROR_INVALID_SERIALIZED_VALUE:
|
||||||
|
return "invalid serialized value";
|
||||||
|
default:
|
||||||
|
return "UNKNOWN";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static const AdcDeserializerCategory& get()
|
||||||
|
{
|
||||||
|
static const AdcDeserializerCategory constInst;
|
||||||
|
return constInst;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* BASE SERIALIZER CLASS (FOR IMPLEMENTATIONS BELOW) */
|
||||||
|
|
||||||
|
struct AdcSerializerBase : adc_serializer_interface_t<adc_serialization_error_t> {
|
||||||
|
virtual ~AdcSerializerBase() = default;
|
||||||
|
|
||||||
|
using typename adc_serializer_interface_t<adc_serialization_error_t>::error_t;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
AdcSerializerBase() = default;
|
||||||
|
|
||||||
|
static void addElemDelimiter(traits::adc_output_char_range auto& output,
|
||||||
|
adc_serialization_params_c auto const& params)
|
||||||
|
{
|
||||||
|
std::format_to(std::back_inserter(output), "{}", params.elem_delim);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void addSeqDelimiter(traits::adc_output_char_range auto& output,
|
||||||
|
adc_serialization_params_c auto const& params)
|
||||||
|
{
|
||||||
|
std::format_to(std::back_inserter(output), "{}", params.seq_delim);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template <typename VT, typename R>
|
||||||
|
requires(std::ranges::input_range<R> && std::same_as<VT, std::ranges::range_value_t<R>>)
|
||||||
|
static error_t serializeRange(adc_serializer_c auto& sr,
|
||||||
|
R const& r,
|
||||||
|
traits::adc_output_char_range auto& output,
|
||||||
|
adc_serialization_params_c auto const& params)
|
||||||
|
{
|
||||||
|
size_t i = 0, N = std::ranges::size(r);
|
||||||
|
|
||||||
|
for (auto const& el : r) {
|
||||||
|
auto err = sr(output, el, params);
|
||||||
|
if (err) {
|
||||||
|
return adc_deduced_err(err, AdcSerializerErrorCode::ERROR_UNDERLYING_SERIALIZER);
|
||||||
|
}
|
||||||
|
if (++i < N) {
|
||||||
|
// AdcSerializerBase::addSeqDelimiter(output, params);
|
||||||
|
AdcSerializerBase::addElemDelimiter(output, params);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return AdcSerializerErrorCode::ERROR_OK;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* BASE DESERIALIZER CLASS (FOR IMPLEMENTATIONS BELOW) */
|
||||||
|
|
||||||
|
struct AdcDeserializerBase : adc_deserializer_interface_t<adc_serialization_error_t> {
|
||||||
|
using typename adc_deserializer_interface_t<adc_serialization_error_t>::error_t;
|
||||||
|
|
||||||
|
virtual ~AdcDeserializerBase() = default;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
AdcDeserializerBase() = default;
|
||||||
|
|
||||||
|
//
|
||||||
|
// empty == true, if the 'input' is empty or if all elements consist of only spaces
|
||||||
|
//
|
||||||
|
static std::vector<std::string_view> splitValueIntoElements(traits::adc_input_char_range auto const& input,
|
||||||
|
adc_serialization_params_c auto const& params,
|
||||||
|
bool& empty)
|
||||||
|
{
|
||||||
|
static_assert(std::ranges::contiguous_range<decltype(input)>, "NOT IMPLEMENTED FOR NON-CONTIGUIUS RANGES!!!");
|
||||||
|
|
||||||
|
std::vector<std::string_view> res;
|
||||||
|
|
||||||
|
if (std::ranges::size(input)) {
|
||||||
|
empty = true;
|
||||||
|
|
||||||
|
std::ranges::for_each(std::views::split(input, params.elem_delim), [&res, &empty](auto const& el) {
|
||||||
|
std::back_inserter(res) = utils::AdcTrimSpacesView<std::string_view, std::string_view>(
|
||||||
|
std::string_view{el.begin(), el.end()});
|
||||||
|
if (empty && res.back().size()) {
|
||||||
|
empty = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
empty = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template <typename VT, std::ranges::output_range<VT> R, typename... DeserParamsT>
|
||||||
|
static error_t deserializingRange(adc_deserializer_c auto& dsr,
|
||||||
|
traits::adc_input_char_range auto const& input,
|
||||||
|
R& r,
|
||||||
|
adc_serialization_params_c auto const& params)
|
||||||
|
{
|
||||||
|
if (std::ranges::size(input) == 0) { // ignore an empty input, just return empty range?!!
|
||||||
|
r = R{};
|
||||||
|
return AdcDeserializerErrorCode::ERROR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// auto r_str = std::views::split(input, params.seq_delim);
|
||||||
|
auto r_str = std::views::split(input, params.elem_delim);
|
||||||
|
VT val;
|
||||||
|
|
||||||
|
auto it = r.begin();
|
||||||
|
for (auto const& el : r_str) {
|
||||||
|
// auto err = dsr(el, val, std::forward<DeserParamsT>(params)...);
|
||||||
|
auto err = dsr(el, val, params);
|
||||||
|
if (err) {
|
||||||
|
return adc_deduced_err(err, AdcDeserializerErrorCode::ERROR_UNDERLYING_DESERIALIZER);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (it == r.end()) {
|
||||||
|
if constexpr (!traits::adc_fixed_size_range<R>) {
|
||||||
|
std::back_inserter(r) = val;
|
||||||
|
it = r.end();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
*it = val;
|
||||||
|
++it;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return AdcDeserializerErrorCode::ERROR_OK;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/* MAIN (FALLBACK) TEMPLATED IMPLEMENTATION OF SERIALIZER/DESERIALIZER */
|
||||||
|
|
||||||
|
template <typename VT>
|
||||||
|
struct AdcSerializer : AdcSerializerBase {
|
||||||
|
constexpr static std::string_view serializerName{"ADC-FALLBACK-SERIALIZER"};
|
||||||
|
|
||||||
|
template <adc_serialization_params_c ParamsT = adc_serialization_params_t>
|
||||||
|
error_t operator()(traits::adc_output_char_range auto& output,
|
||||||
|
VT const& value,
|
||||||
|
ParamsT const& params = adc_serialization_params_t{})
|
||||||
|
{
|
||||||
|
if constexpr (std::convertible_to<VT, std::string>) {
|
||||||
|
std::string s = value;
|
||||||
|
std::ranges::copy(s, std::back_inserter(output));
|
||||||
|
} else if constexpr (std::ranges::range<VT>) {
|
||||||
|
using value_t = std::remove_cv_t<std::ranges::range_value_t<VT>>;
|
||||||
|
|
||||||
|
// special range (character sequence)
|
||||||
|
if constexpr (std::same_as<value_t, char>) {
|
||||||
|
std::ranges::copy(value, std::back_inserter(output));
|
||||||
|
} else {
|
||||||
|
AdcSerializer<value_t> sr;
|
||||||
|
|
||||||
|
return AdcSerializerBase::serializeRange<value_t>(sr, value, output, params);
|
||||||
|
}
|
||||||
|
} else if constexpr (traits::adc_tuple_like<VT>) {
|
||||||
|
return [&output, ¶ms]<size_t I = 0>(this auto& self, VT& tp) -> error_t {
|
||||||
|
if constexpr (I < (std::tuple_size_v<VT> - 1)) {
|
||||||
|
auto err = AdcSerializer<std::tuple_element_t<I, VT>>{}(output, std::get<I>(tp), params);
|
||||||
|
if (err) {
|
||||||
|
return AdcSerializerErrorCode::ERROR_UNDERLYING_SERIALIZER;
|
||||||
|
}
|
||||||
|
|
||||||
|
AdcSerializerBase::addElemDelimiter(output, params);
|
||||||
|
|
||||||
|
return self.template operator()<I + 1>(tp);
|
||||||
|
} else if constexpr (I < (std::tuple_size_v<VT> - 1)) { // the last element
|
||||||
|
auto err = AdcSerializer<std::tuple_element_t<I, VT>>{}(output, std::get<I>(tp), params);
|
||||||
|
if (err) {
|
||||||
|
return AdcSerializerErrorCode::ERROR_UNDERLYING_SERIALIZER;
|
||||||
|
}
|
||||||
|
|
||||||
|
return AdcSerializerErrorCode::ERROR_OK;
|
||||||
|
}
|
||||||
|
}(value);
|
||||||
|
} else if constexpr (traits::adc_time_point_c<VT>) {
|
||||||
|
std::string_view fmt{params.timepoint_format};
|
||||||
|
std::vformat_to(std::back_inserter(output), fmt, std::make_format_args(value));
|
||||||
|
} else if constexpr (traits::adc_time_duration_c<VT>) {
|
||||||
|
std::format_to(std::back_inserter(output), "{}", value.count());
|
||||||
|
} else if constexpr (std::formattable<VT, char>) {
|
||||||
|
std::format_to(std::back_inserter(output), "{}", value);
|
||||||
|
} else {
|
||||||
|
static_assert(false, "UNSUPPORTED TYPE!!!");
|
||||||
|
}
|
||||||
|
|
||||||
|
return AdcSerializerErrorCode::ERROR_OK;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template <typename VT>
|
||||||
|
struct AdcDeserializer : AdcDeserializerBase {
|
||||||
|
static constexpr std::string_view deserializerName{"ADC-FALLBACK-DESERIALIZER"};
|
||||||
|
|
||||||
|
virtual ~AdcDeserializer() = default;
|
||||||
|
|
||||||
|
|
||||||
|
template <adc_serialization_params_c ParamsT = adc_serialization_params_t>
|
||||||
|
error_t operator()(traits::adc_input_char_range auto const& input,
|
||||||
|
VT& value,
|
||||||
|
ParamsT const& params = adc_serialization_params_t{})
|
||||||
|
{
|
||||||
|
if constexpr (std::is_arithmetic_v<VT>) {
|
||||||
|
auto v = adc::utils::AdcFromChars<VT>(utils::AdcTrimSpaces(input));
|
||||||
|
if (!v.has_value()) {
|
||||||
|
return AdcDeserializerErrorCode::ERROR_INVALID_SERIALIZED_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = v.value();
|
||||||
|
} else if constexpr (adc::traits::adc_output_char_range<VT>) {
|
||||||
|
VT r;
|
||||||
|
if constexpr (traits::adc_fixed_size_range<VT>) {
|
||||||
|
size_t N =
|
||||||
|
std::ranges::size(r) <= std::ranges::size(input) ? std::ranges::size(r) : std::ranges::size(input);
|
||||||
|
|
||||||
|
for (size_t i = 0; i < N; ++i) {
|
||||||
|
r[i] = input[i];
|
||||||
|
}
|
||||||
|
if (std::ranges::size(r) > N) {
|
||||||
|
for (size_t i = N; i < std::ranges::size(r); ++i) {
|
||||||
|
r[i] = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
std::ranges::copy(input, std::back_inserter(r));
|
||||||
|
}
|
||||||
|
|
||||||
|
value = r;
|
||||||
|
} else if constexpr (std::ranges::range<VT>) {
|
||||||
|
using el_t = std::ranges::range_value_t<VT>;
|
||||||
|
|
||||||
|
static_assert(std::ranges::output_range<VT, el_t>, "INVALID RANGE TYPE!!!");
|
||||||
|
|
||||||
|
// no reference or constants allowed
|
||||||
|
static_assert(!(std::is_reference_v<el_t> || std::is_const_v<el_t>), "INVALID RANGE ELEMENT TYPE!!!");
|
||||||
|
|
||||||
|
AdcDeserializer<el_t> dsr;
|
||||||
|
return deserializingRange<el_t>(dsr, input, value, params);
|
||||||
|
} else if constexpr (traits::adc_tuple_like<VT>) {
|
||||||
|
bool empty;
|
||||||
|
auto elems = splitValueIntoElements(input, params, &empty);
|
||||||
|
if (empty) {
|
||||||
|
value = VT{};
|
||||||
|
} else {
|
||||||
|
return [&input, ¶ms, &elems]<size_t I = 0>(this auto& self, VT& tp) {
|
||||||
|
if constexpr (I < std::tuple_size_v<VT>) {
|
||||||
|
if (I < elems.size()) {
|
||||||
|
auto err =
|
||||||
|
AdcDeserializer<std::tuple_element_t<I, VT>>{}(elems[I], std::get<I>(tp), params);
|
||||||
|
if (err) {
|
||||||
|
return AdcDeserializerErrorCode::ERROR_UNDERLYING_DESERIALIZER;
|
||||||
|
}
|
||||||
|
|
||||||
|
return self.template operator()<I + 1>(tp);
|
||||||
|
} else {
|
||||||
|
return AdcDeserializerErrorCode::ERROR_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return AdcDeserializerErrorCode::ERROR_OK;
|
||||||
|
}(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if constexpr (traits::adc_time_point_c<VT>) {
|
||||||
|
std::istringstream ist{utils::AdcTrimSpaces<std::string>(input)};
|
||||||
|
std::chrono::from_stream(ist, params.timepoint_format.c_str(), value);
|
||||||
|
if (ist.fail()) {
|
||||||
|
return AdcDeserializerErrorCode::ERROR_INVALID_SERIALIZED_VALUE;
|
||||||
|
}
|
||||||
|
} else if constexpr (traits::adc_time_duration_c<VT>) {
|
||||||
|
typename VT::rep vd;
|
||||||
|
|
||||||
|
AdcDeserializer<typename VT::rep> dsr;
|
||||||
|
|
||||||
|
auto err = dsr(utils::AdcTrimSpaces(input), vd, params);
|
||||||
|
if (err) {
|
||||||
|
return adc_deduced_err(err, AdcDeserializerErrorCode::ERROR_UNDERLYING_DESERIALIZER);
|
||||||
|
}
|
||||||
|
|
||||||
|
value = VT{vd};
|
||||||
|
} else {
|
||||||
|
static_assert(false, "UNSUPPORTED VALUE TYPE!!!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return AdcDeserializerErrorCode::ERROR_OK;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} // namespace adc
|
||||||
@@ -86,6 +86,17 @@ struct adc_char_identity {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// std::array, std::span(v_t, N), std::tuple
|
||||||
|
template <typename R>
|
||||||
|
concept adc_fixed_size_range = std::ranges::range<R> && requires { std::tuple_size<std::remove_cvref_t<R>>::value; };
|
||||||
|
|
||||||
|
// non-resizable ranges
|
||||||
|
template <typename R>
|
||||||
|
concept adc_non_resizable_range = std::ranges::range<R> && !requires(R r, std::size_t n) { r.resize(n); };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// deduce returned type of callable
|
// deduce returned type of callable
|
||||||
// template <typename T>
|
// template <typename T>
|
||||||
// using adc_retval_t = std::invoke_result_t<std::remove_cvref_t<T>>;
|
// using adc_retval_t = std::invoke_result_t<std::remove_cvref_t<T>>;
|
||||||
@@ -270,6 +281,13 @@ using adc_common_duration_t = adc_duration_common_type_t<std::chrono::nanosecond
|
|||||||
std::chrono::years>;
|
std::chrono::years>;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
concept adc_time_point_c = requires {
|
||||||
|
[]<typename ClockT, typename DurT>(std::type_identity<std::chrono::time_point<ClockT, DurT>>) {
|
||||||
|
}(std::type_identity<std::remove_cvref_t<T>>());
|
||||||
|
};
|
||||||
|
|
||||||
// concept for hashable types
|
// concept for hashable types
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept adc_hashable_c = requires(T t) {
|
concept adc_hashable_c = requires(T t) {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <charconv>
|
#include <charconv>
|
||||||
|
#include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|||||||
464
tart
Normal file
464
tart
Normal file
@@ -0,0 +1,464 @@
|
|||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229mpragma once[39m
|
||||||
|
|
||||||
|
[38;2;0;255;0m/*[39m
|
||||||
|
|
||||||
|
[38;2;0;255;0mABSTRACT DEVICE COMPONENTS LIBRARY[39m
|
||||||
|
|
||||||
|
[38;2;0;255;0m*/[39m
|
||||||
|
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229minclude[39m[38;2;221;221;221m [39m[38;2;0;255;0m<filesystem>[39m
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229minclude[39m[38;2;221;221;221m [39m[38;2;0;255;0m<functional>[39m
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229minclude[39m[38;2;221;221;221m [39m[38;2;0;255;0m<list>[39m
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229minclude[39m[38;2;221;221;221m [39m[38;2;0;255;0m<set>[39m
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229minclude[39m[38;2;221;221;221m [39m[38;2;0;255;0m<unordered_map>[39m
|
||||||
|
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229mif __has_include(<unistd.h>) [39m[38;2;0;255;0m// POSIX[39m
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229mdefine FORK_EXISTS 1[39m
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229minclude[39m[38;2;221;221;221m [39m[38;2;0;255;0m<sys/stat.h>[39m
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229minclude[39m[38;2;221;221;221m [39m[38;2;0;255;0m<unistd.h>[39m
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229minclude[39m[38;2;221;221;221m [39m[38;2;0;255;0m<cerrno>[39m
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229mendif[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229minclude[39m[38;2;221;221;221m [39m[38;2;0;255;0m"../common/adc_utils.h"[39m
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229minclude[39m[38;2;221;221;221m [39m[38;2;0;255;0m"adc_net_concepts.h"[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;221;221;221mnamespace[39m[38;2;221;221;221m [39m[38;2;221;221;221madc[39m
|
||||||
|
[38;2;221;221;221m{[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;0;255;0m/* SOME USEFULL PRIVITIVES */[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;0;255;0m// A generic implementation of POSIX OS daemon[39m
|
||||||
|
[38;2;221;221;221mclass[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcPosixGenericDaemon[39m
|
||||||
|
[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221mpublic[39m[38;2;221;221;221m:[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mvirtual[39m[38;2;221;221;221m [39m[38;2;221;221;221m~[39m[38;2;221;221;221mAdcPosixGenericDaemon[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;255;0;0mdefault[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;0;255;0m// run server as daemon (still only on POSIX OSes)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m [39m[38;2;255;255;0mdaemonize[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mdaemonizePrepare[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;0;255;0m// reference implementation of forking for POSIX OSes[39m
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229mifdef FORK_EXISTS[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;0;255;0m// get TEMP directory in OS[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mauto[39m[38;2;221;221;221m [39m[38;2;221;221;221mtmp_path[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mfilesystem[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mtemp_directory_path[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221mtmp_path[39m[38;2;221;221;221m.[39m[38;2;221;221;221mempty[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtmp_path[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mfilesystem[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mcurrent_path[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m.[39m[38;2;221;221;221mroot_path[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;238;130;238mpid_t[39m[38;2;221;221;221m [39m[38;2;221;221;221mpid[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mfork[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221mpid[39m[38;2;221;221;221m [39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;255;0;255m0[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mexit[39m[38;2;221;221;221m([39m[38;2;255;0;255m0[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m [39m[38;2;255;0;0melse[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mthrow[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221msystem_error[39m[38;2;221;221;221m([39m[38;2;221;221;221merrno[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mgeneric_category[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;135;206;235m"[39m[38;2;135;206;235mCANNOT FORK 1-STAGE[39m[38;2;135;206;235m"[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221msetsid[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;255;0;255m-1[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mthrow[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221msystem_error[39m[38;2;221;221;221m([39m[38;2;221;221;221merrno[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mgeneric_category[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;135;206;235m"[39m[38;2;135;206;235mCANNOT FORK SETSID[39m[38;2;135;206;235m"[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mfilesystem[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mcurrent_path[39m[38;2;221;221;221m([39m[38;2;221;221;221mtmp_path[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mumask[39m[38;2;221;221;221m([39m[38;2;255;0;255m0[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;238;130;238mpid_t[39m[38;2;221;221;221m [39m[38;2;221;221;221mpid[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mfork[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221mpid[39m[38;2;221;221;221m [39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;255;0;255m0[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mexit[39m[38;2;221;221;221m([39m[38;2;255;0;255m0[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m [39m[38;2;255;0;0melse[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mthrow[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221msystem_error[39m[38;2;221;221;221m([39m[38;2;221;221;221merrno[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mgeneric_category[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;135;206;235m"[39m[38;2;135;206;235mCANNOT FORK 2-STAGE[39m[38;2;135;206;235m"[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mclose[39m[38;2;221;221;221m([39m[38;2;255;0;255m0[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mclose[39m[38;2;221;221;221m([39m[38;2;255;0;255m1[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mclose[39m[38;2;221;221;221m([39m[38;2;255;0;255m2[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;229;229;229m#[39m[38;2;229;229;229mendif[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mdaemonizeFinalize[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221mprotected[39m[38;2;221;221;221m:[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mvirtual[39m[38;2;221;221;221m [39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m [39m[38;2;221;221;221mdaemonizePrepare[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;255;0;255m0[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mvirtual[39m[38;2;221;221;221m [39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m [39m[38;2;221;221;221mdaemonizeFinalize[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;255;0;255m0[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m}[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;0;255;0m// a basic network session manager (basic start and stop functionality)[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221mclass[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m
|
||||||
|
[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221mpublic[39m[38;2;221;221;221m:[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mvirtual[39m[38;2;221;221;221m [39m[38;2;221;221;221m~[39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;255;0;0mdefault[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221mprotected[39m[38;2;221;221;221m:[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;255;0;0mdefault[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m&[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mdelete[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m([39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m&[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mother[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mmoveInstFunc[39m[38;2;221;221;221m([39m[38;2;221;221;221m&[39m[38;2;221;221;221mother[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mthis[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221moperator[39m[38;2;221;221;221m=[39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m&[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mdelete[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221moperator[39m[38;2;221;221;221m=[39m[38;2;221;221;221m([39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m&[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mother[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mmoveInstFunc[39m[38;2;221;221;221m([39m[38;2;221;221;221m&[39m[38;2;221;221;221mother[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mthis[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mreturn[39m[38;2;221;221;221m [39m[38;2;221;221;221m*[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221minterfaces[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221madc_netsession_c[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mconstexpr[39m[38;2;221;221;221m [39m[38;2;255;0;0mstatic[39m[38;2;221;221;221m [39m[38;2;238;130;238mbool[39m[38;2;221;221;221m [39m[38;2;221;221;221manySessionPredicate[39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mnetsession_ident_t[39m[38;2;221;221;221m&[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mreturn[39m[38;2;221;221;221m [39m[38;2;221;221;221mtrue[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;0;255;0m// started sessions weak pointers[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221minterfaces[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221madc_netsession_c[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mstatic[39m[38;2;221;221;221m [39m[38;2;255;0;0minline[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221munordered_map[39m[38;2;221;221;221m<[39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m*[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mlist[39m[38;2;221;221;221m<[39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mweak_ptr[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m>[39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;221;221;221m_serverSessions[39m[38;2;221;221;221m{[39m[38;2;221;221;221m}[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mvector[39m[38;2;221;221;221m<[39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mfunction[39m[38;2;221;221;221m<[39m[38;2;238;130;238mbool[39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221m>[39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;221;221;221m_stopSessionFunc[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mvector[39m[38;2;221;221;221m<[39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mfunction[39m[38;2;221;221;221m<[39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m*[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221m>[39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;221;221;221m_moveCtorFunc[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221minterfaces[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221madc_netsession_c[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m [39m[38;2;221;221;221mstartSession[39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mshared_ptr[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221msess_ptr[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mauto[39m[38;2;221;221;221m [39m[38;2;221;221;221mit[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221m_serverSessions[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m][39m[38;2;221;221;221m.[39m[38;2;221;221;221mend[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mit[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221m_serverSessions[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m][39m[38;2;221;221;221m.[39m[38;2;221;221;221memplace[39m[38;2;221;221;221m([39m[38;2;221;221;221mit[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221msess_ptr[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221msess_ptr[39m[38;2;221;221;221m-[39m[38;2;221;221;221m>[39m[38;2;221;221;221mstart[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_stopSessionFunc[39m[38;2;221;221;221m.[39m[38;2;221;221;221memplace_back[39m[38;2;221;221;221m([39m[38;2;221;221;221m[[39m[38;2;221;221;221mit[39m[38;2;221;221;221m][39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m*[39m[38;2;221;221;221m [39m[38;2;221;221;221minst[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221m![39m[38;2;221;221;221mit[39m[38;2;221;221;221m-[39m[38;2;221;221;221m>[39m[38;2;221;221;221mexpired[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m[38;2;221;221;221m [39m[38;2;0;255;0m// session is still existing[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mauto[39m[38;2;221;221;221m [39m[38;2;221;221;221msess[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mit[39m[38;2;221;221;221m-[39m[38;2;221;221;221m>[39m[38;2;221;221;221mlock[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221msess[39m[38;2;221;221;221m-[39m[38;2;221;221;221m>[39m[38;2;221;221;221mstop[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_serverSessions[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221minst[39m[38;2;221;221;221m][39m[38;2;221;221;221m.[39m[38;2;221;221;221merase[39m[38;2;221;221;221m([39m[38;2;221;221;221mit[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mreturn[39m[38;2;221;221;221m [39m[38;2;221;221;221mtrue[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m [39m[38;2;255;0;0melse[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mreturn[39m[38;2;221;221;221m [39m[38;2;221;221;221mfalse[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;0;255;0m// define move-function only once per SessionT![39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221m_serverSessions[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m][39m[38;2;221;221;221m.[39m[38;2;221;221;221msize[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;255;0;255m1[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_moveCtorFunc[39m[38;2;221;221;221m.[39m[38;2;221;221;221memplace_back[39m[38;2;221;221;221m([39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m[[39m[38;2;221;221;221m][39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m*[39m[38;2;221;221;221m [39m[38;2;221;221;221mnew_instance[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m*[39m[38;2;221;221;221m [39m[38;2;221;221;221mfrom_inst[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_serverSessions[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221mnew_instance[39m[38;2;221;221;221m][39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221m_serverSessions[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221mfrom_inst[39m[38;2;221;221;221m][39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221minterfaces[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221madc_netsession_c[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m,[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mpredicate[39m[38;2;221;221;221m<[39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mnetsession_ident_t[39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;221;221;221mPredT[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mdecltype[39m[38;2;221;221;221m([39m[38;2;221;221;221manySessionPredicate[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m)[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238msize_t[39m[38;2;221;221;221m [39m[38;2;221;221;221mstopSessions[39m[38;2;221;221;221m([39m[38;2;221;221;221mPredT[39m[38;2;221;221;221m&[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mcomp_func[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221manySessionPredicate[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238msize_t[39m[38;2;221;221;221m [39m[38;2;221;221;221mN[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;255;0;255m0[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mset[39m[38;2;221;221;221m<[39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mweak_ptr[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;221;221;221mremove_wptr[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mfor[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;255;0;0mauto[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mwptr[39m[38;2;221;221;221m [39m[38;2;221;221;221m:[39m[38;2;221;221;221m [39m[38;2;221;221;221m_serverSessions[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m][39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mshared_ptr[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;221;221;221msptr[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mwptr[39m[38;2;221;221;221m.[39m[38;2;221;221;221mlock[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221mconstexpr[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221msame_as[39m[38;2;221;221;221m<[39m[38;2;221;221;221mPredT[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mdecltype[39m[38;2;221;221;221m([39m[38;2;221;221;221manySessionPredicate[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m)[39m[38;2;221;221;221m>[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221msptr[39m[38;2;221;221;221m-[39m[38;2;221;221;221m>[39m[38;2;221;221;221mstop[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mremove_wptr[39m[38;2;221;221;221m.[39m[38;2;221;221;221memplace[39m[38;2;221;221;221m([39m[38;2;221;221;221mwptr[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m+[39m[38;2;221;221;221m+[39m[38;2;221;221;221mN[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m [39m[38;2;255;0;0melse[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mforward[39m[38;2;221;221;221m<[39m[38;2;221;221;221mPredT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m([39m[38;2;221;221;221mcomp_func[39m[38;2;221;221;221m)[39m[38;2;221;221;221m([39m[38;2;221;221;221msptr[39m[38;2;221;221;221m-[39m[38;2;221;221;221m>[39m[38;2;221;221;221mident[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221msptr[39m[38;2;221;221;221m-[39m[38;2;221;221;221m>[39m[38;2;221;221;221mstop[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mremove_wptr[39m[38;2;221;221;221m.[39m[38;2;221;221;221memplace[39m[38;2;221;221;221m([39m[38;2;221;221;221mwptr[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m+[39m[38;2;221;221;221m+[39m[38;2;221;221;221mN[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m [39m[38;2;255;0;0melse[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m[38;2;221;221;221m [39m[38;2;0;255;0m// remove already stopped sessions?!![39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mremove_wptr[39m[38;2;221;221;221m.[39m[38;2;221;221;221memplace[39m[38;2;221;221;221m([39m[38;2;221;221;221mwptr[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mfor[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;255;0;0mauto[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mwptr[39m[38;2;221;221;221m [39m[38;2;221;221;221m:[39m[38;2;221;221;221m [39m[38;2;221;221;221mremove_wptr[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_serverSessions[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m][39m[38;2;221;221;221m.[39m[38;2;221;221;221merase[39m[38;2;221;221;221m([39m[38;2;221;221;221mwptr[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mreturn[39m[38;2;221;221;221m [39m[38;2;221;221;221mN[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238msize_t[39m[38;2;221;221;221m [39m[38;2;221;221;221mstopAllSessions[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238msize_t[39m[38;2;221;221;221m [39m[38;2;221;221;221mN[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;255;0;255m0[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mfor[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;255;0;0mauto[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mfunc[39m[38;2;221;221;221m [39m[38;2;221;221;221m:[39m[38;2;221;221;221m [39m[38;2;221;221;221m_stopSessionFunc[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mfunc[39m[38;2;221;221;221m([39m[38;2;221;221;221mthis[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m?[39m[38;2;221;221;221m [39m[38;2;221;221;221m+[39m[38;2;221;221;221m+[39m[38;2;221;221;221mN[39m[38;2;221;221;221m [39m[38;2;221;221;221m:[39m[38;2;221;221;221m [39m[38;2;255;0;255m0[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_stopSessionFunc[39m[38;2;221;221;221m.[39m[38;2;221;221;221mclear[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_moveCtorFunc[39m[38;2;221;221;221m.[39m[38;2;221;221;221mclear[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m[38;2;221;221;221m [39m[38;2;0;255;0m// there are nothing to move after stopping of all sessions[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mreturn[39m[38;2;221;221;221m [39m[38;2;221;221;221mN[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m [39m[38;2;221;221;221mmoveInstFunc[39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m*[39m[38;2;221;221;221m [39m[38;2;221;221;221mto[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m*[39m[38;2;221;221;221m [39m[38;2;221;221;221mfrom[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221mfrom[39m[38;2;221;221;221m [39m[38;2;221;221;221m![39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mto[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mfor[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;255;0;0mauto[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mfunc[39m[38;2;221;221;221m [39m[38;2;221;221;221m:[39m[38;2;221;221;221m [39m[38;2;221;221;221m_moveCtorFunc[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mfunc[39m[38;2;221;221;221m([39m[38;2;221;221;221mto[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mfrom[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_stopSessionFunc[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mfrom[39m[38;2;221;221;221m-[39m[38;2;221;221;221m>[39m[38;2;221;221;221m_stopSessionFunc[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_moveCtorFunc[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mfrom[39m[38;2;221;221;221m-[39m[38;2;221;221;221m>[39m[38;2;221;221;221m_moveCtorFunc[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
[38;2;221;221;221m}[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;255;0;0mstatic_assert[39m[38;2;221;221;221m([39m[38;2;221;221;221minterfaces[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221madc_logger_c[39m[38;2;221;221;221m<[39m[38;2;221;221;221mutils[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mAdcOstreamLogger[39m[38;2;221;221;221m<[39m[38;2;221;221;221m>[39m[38;2;221;221;221m>[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;135;206;235m"[39m[38;2;135;206;235m!!!!![39m[38;2;135;206;235m"[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;0;255;0m/* very generic network server */[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mIdentT[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mstring[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221minterfaces[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221madc_logger_c[39m[38;2;221;221;221m [39m[38;2;221;221;221mLoggerT[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mutils[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mAdcOstreamLogger[39m[38;2;221;221;221m<[39m[38;2;238;130;238mchar[39m[38;2;221;221;221m>[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221mclass[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m [39m[38;2;221;221;221m:[39m[38;2;221;221;221m [39m[38;2;221;221;221mpublic[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcPosixGenericDaemon[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mpublic[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mpublic[39m[38;2;221;221;221m [39m[38;2;221;221;221mLoggerT[39m
|
||||||
|
[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221mpublic[39m[38;2;221;221;221m:[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mtypedef[39m[38;2;221;221;221m [39m[38;2;221;221;221mIdentT[39m[38;2;221;221;221m [39m[38;2;221;221;221mserver_ident_t[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mtypedef[39m[38;2;221;221;221m [39m[38;2;221;221;221mLoggerT[39m[38;2;221;221;221m [39m[38;2;221;221;221mlogger_t[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m [39m[38;2;221;221;221mLoggerCtorArgTs[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mserver_ident_t[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mid[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mLoggerCtorArgTs[39m[38;2;221;221;221m&[39m[38;2;221;221;221m&[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m [39m[38;2;221;221;221mctor_args[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m:[39m[38;2;221;221;221m [39m[38;2;221;221;221m_serverIdent[39m[38;2;221;221;221m([39m[38;2;221;221;221mid[39m[38;2;221;221;221m)[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mLoggerT[39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mforward[39m[38;2;221;221;221m<[39m[38;2;221;221;221mLoggerCtorArgTs[39m[38;2;221;221;221m>[39m[38;2;221;221;221m([39m[38;2;221;221;221mctor_args[39m[38;2;221;221;221m)[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221mconstexpr[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221mtraits[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformattable[39m[38;2;221;221;221m<[39m[38;2;221;221;221mIdentT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mlogInfo[39m[38;2;221;221;221m([39m[38;2;135;206;235m"[39m[38;2;135;206;235mCreate ADC generic network server with ID: {} (addr = {}, thread = {})[39m[38;2;135;206;235m"[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mid[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m,[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mutils[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mAdcThisThreadId[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m [39m[38;2;255;0;0melse[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mlogInfo[39m[38;2;221;221;221m([39m[38;2;135;206;235m"[39m[38;2;135;206;235mCreate ADC generic network server (addr = {}, thread = {})[39m[38;2;135;206;235m"[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m,[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mutils[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mAdcThisThreadId[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m&[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mdelete[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m([39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m&[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mother[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m:[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcPosixGenericDaemon[39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mother[39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mother[39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mLoggerT[39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mother[39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mlogDebug[39m[38;2;221;221;221m([39m[38;2;135;206;235m"[39m[38;2;135;206;235mMove ADC server class: this = {}, target = {}[39m[38;2;135;206;235m"[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221m&[39m[38;2;221;221;221mother[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221mthis[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221m&[39m[38;2;221;221;221mother[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mreturn[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_serverIdent[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mother[39m[38;2;221;221;221m.[39m[38;2;221;221;221m_serverIdent[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_stopListenFunc[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mother[39m[38;2;221;221;221m.[39m[38;2;221;221;221m_stopListenFunc[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mfor[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;255;0;0mauto[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mfunc[39m[38;2;221;221;221m [39m[38;2;221;221;221m:[39m[38;2;221;221;221m [39m[38;2;221;221;221mother[39m[38;2;221;221;221m.[39m[38;2;221;221;221m_moveCtorFunc[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mfunc[39m[38;2;221;221;221m([39m[38;2;221;221;221m&[39m[38;2;221;221;221mother[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mthis[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_moveCtorFunc[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mother[39m[38;2;221;221;221m.[39m[38;2;221;221;221m_moveCtorFunc[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mvirtual[39m[38;2;221;221;221m [39m[38;2;221;221;221m~[39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221mconstexpr[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221mtraits[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformattable[39m[38;2;221;221;221m<[39m[38;2;221;221;221mIdentT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mlogInfo[39m[38;2;221;221;221m([39m[38;2;135;206;235m"[39m[38;2;135;206;235mDelete ADC generic network server with ID: {} (addr = {}, thread = {})[39m[38;2;135;206;235m"[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221m_serverIdent[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m,[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mutils[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mAdcThisThreadId[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m [39m[38;2;255;0;0melse[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mlogInfo[39m[38;2;221;221;221m([39m[38;2;135;206;235m"[39m[38;2;135;206;235mDelete ADC generic network server (addr = {}, thread = {})[39m[38;2;135;206;235m"[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m,[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mutils[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mAdcThisThreadId[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221moperator[39m[38;2;221;221;221m=[39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m&[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mdelete[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221moperator[39m[38;2;221;221;221m=[39m[38;2;221;221;221m([39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m&[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mother[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mlogDebug[39m[38;2;221;221;221m([39m[38;2;135;206;235m"[39m[38;2;135;206;235mAssign-move ADC server class: this = {}, target = {}[39m[38;2;135;206;235m"[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221m&[39m[38;2;221;221;221mother[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221mthis[39m[38;2;221;221;221m [39m[38;2;221;221;221m![39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221m&[39m[38;2;221;221;221mother[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mAdcPosixGenericDaemon[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221moperator[39m[38;2;221;221;221m=[39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mother[39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mAdcNetSessionManager[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221moperator[39m[38;2;221;221;221m=[39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mother[39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_serverIdent[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mother[39m[38;2;221;221;221m.[39m[38;2;221;221;221m_serverIdent[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_stopListenFunc[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mother[39m[38;2;221;221;221m.[39m[38;2;221;221;221m_stopListenFunc[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mfor[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;255;0;0mauto[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mfunc[39m[38;2;221;221;221m [39m[38;2;221;221;221m:[39m[38;2;221;221;221m [39m[38;2;221;221;221mother[39m[38;2;221;221;221m.[39m[38;2;221;221;221m_moveCtorFunc[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mfunc[39m[38;2;221;221;221m([39m[38;2;221;221;221m&[39m[38;2;221;221;221mother[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mthis[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_moveCtorFunc[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mother[39m[38;2;221;221;221m.[39m[38;2;221;221;221m_moveCtorFunc[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mreturn[39m[38;2;221;221;221m [39m[38;2;221;221;221m*[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mvirtual[39m[38;2;221;221;221m [39m[38;2;221;221;221mserver_ident_t[39m[38;2;221;221;221m [39m[38;2;221;221;221mident[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;255;0;0mconst[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mreturn[39m[38;2;221;221;221m [39m[38;2;221;221;221m_serverIdent[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;0;255;0m// start accepting remote connections, create and start given network session[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;0;255;0m// It must be assumed that this is asynchronous operation!!![39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221minterfaces[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221madc_netsession_c[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m [39m[38;2;221;221;221mAcceptorCtorArgTs[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m [39m[38;2;221;221;221mstart[39m[38;2;221;221;221m([39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mnetsession_ident_t[39m[38;2;221;221;221m [39m[38;2;221;221;221mid[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mnetsession_ctx_t[39m[38;2;221;221;221m [39m[38;2;221;221;221msess_ctx[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mAcceptorCtorArgTs[39m[38;2;221;221;221m&[39m[38;2;221;221;221m&[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m [39m[38;2;221;221;221mctor_args[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mrequires[39m[38;2;221;221;221m [39m[38;2;221;221;221mtraits[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221madc_hashable_c[39m[38;2;221;221;221m<[39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mnetsession_ident_t[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mlogDebug[39m[38;2;221;221;221m([39m[38;2;135;206;235m"[39m[38;2;135;206;235mCall {}[39m[38;2;135;206;235m"[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221m__PRETTY_FUNCTION__[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221m![39m[38;2;221;221;221m_isListening[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m][39m[38;2;221;221;221m[[39m[38;2;221;221;221mid[39m[38;2;221;221;221m][39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mauto[39m[38;2;221;221;221m [39m[38;2;221;221;221macceptor[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmake_shared[39m[38;2;221;221;221m<[39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mnetservice_t[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221macceptor_t[39m[38;2;221;221;221m>[39m[38;2;221;221;221m([39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mforward[39m[38;2;221;221;221m<[39m[38;2;221;221;221mAcceptorCtorArgTs[39m[38;2;221;221;221m>[39m[38;2;221;221;221m([39m[38;2;221;221;221mctor_args[39m[38;2;221;221;221m)[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_stopListenFunc[39m[38;2;221;221;221m.[39m[38;2;221;221;221memplace_back[39m[38;2;221;221;221m([39m[38;2;221;221;221m[[39m[38;2;221;221;221macceptor[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mid[39m[38;2;221;221;221m][39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m*[39m[38;2;221;221;221m [39m[38;2;221;221;221minst[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221merror_code[39m[38;2;221;221;221m [39m[38;2;221;221;221mec[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221macceptor[39m[38;2;221;221;221m-[39m[38;2;221;221;221m>[39m[38;2;221;221;221mclose[39m[38;2;221;221;221m([39m[38;2;221;221;221mec[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_isListening[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221minst[39m[38;2;221;221;221m][39m[38;2;221;221;221m[[39m[38;2;221;221;221mid[39m[38;2;221;221;221m][39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mfalse[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221mconstexpr[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221mtraits[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformattable[39m[38;2;221;221;221m<[39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mnetsession_ident_t[39m[38;2;221;221;221m>[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mlogInfo[39m[38;2;221;221;221m([39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;135;206;235m"[39m[38;2;135;206;235mStart listening for client connections at <{}> endpoint (session ID: {}, server addr = {}, thread [39m[38;2;135;206;235m"[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;135;206;235m"[39m[38;2;135;206;235m= {})[39m[38;2;135;206;235m"[39m[38;2;221;221;221m,[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221macceptor[39m[38;2;221;221;221m-[39m[38;2;221;221;221m>[39m[38;2;221;221;221mlocalEndpoint[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mid[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mutils[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mAdcThisThreadId[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m [39m[38;2;255;0;0melse[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mlogInfo[39m[38;2;221;221;221m([39m[38;2;135;206;235m"[39m[38;2;135;206;235mStart listening for client connections at <{}> endpoint (server addr = {}, thread = {})[39m[38;2;135;206;235m"[39m[38;2;221;221;221m,[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221macceptor[39m[38;2;221;221;221m-[39m[38;2;221;221;221m>[39m[38;2;221;221;221mlocalEndpoint[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mutils[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mAdcThisThreadId[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mdoAccept[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m([39m[38;2;221;221;221macceptor[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mid[39m[38;2;221;221;221m)[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221msess_ctx[39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;0;255;0m// only once per SessionT[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221m_isListening[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m][39m[38;2;221;221;221m.[39m[38;2;221;221;221msize[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;255;0;255m1[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_moveCtorFunc[39m[38;2;221;221;221m.[39m[38;2;221;221;221memplace_back[39m[38;2;221;221;221m([39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m[[39m[38;2;221;221;221m][39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m*[39m[38;2;221;221;221m [39m[38;2;221;221;221mnew_instance[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m*[39m[38;2;221;221;221m [39m[38;2;221;221;221mfrom_inst[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_isListening[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221mnew_instance[39m[38;2;221;221;221m][39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221m_isListening[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221mfrom_inst[39m[38;2;221;221;221m][39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221minterfaces[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221madc_netsession_c[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238mbool[39m[38;2;221;221;221m [39m[38;2;221;221;221misListening[39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mnetsession_ident_t[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mid[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;255;0;0mconst[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mreturn[39m[38;2;221;221;221m [39m[38;2;221;221;221m_isListening[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m][39m[38;2;221;221;221m[[39m[38;2;221;221;221mid[39m[38;2;221;221;221m][39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mvirtual[39m[38;2;221;221;221m [39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m [39m[38;2;221;221;221mstart[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;255;0;255m0[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mvirtual[39m[38;2;221;221;221m [39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m [39m[38;2;221;221;221mstop[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mfor[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;255;0;0mauto[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mfunc[39m[38;2;221;221;221m [39m[38;2;221;221;221m:[39m[38;2;221;221;221m [39m[38;2;221;221;221m_stopListenFunc[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mfunc[39m[38;2;221;221;221m([39m[38;2;221;221;221mthis[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_stopListenFunc[39m[38;2;221;221;221m.[39m[38;2;221;221;221mclear[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mstopAllSessions[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m [39m[38;2;255;255;0msetAcceptTimeout[39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mtraits[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221madc_time_duration_c[39m[38;2;221;221;221m [39m[38;2;255;0;0mauto[39m[38;2;221;221;221m&[39m[38;2;221;221;221m [39m[38;2;221;221;221mtimeout[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_acceptTimeout[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mchrono[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mduration_cast[39m[38;2;221;221;221m<[39m[38;2;221;221;221mdecltype[39m[38;2;221;221;221m([39m[38;2;221;221;221m_acceptTimeout[39m[38;2;221;221;221m)[39m[38;2;221;221;221m>[39m[38;2;221;221;221m([39m[38;2;221;221;221mtimeout[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mauto[39m[38;2;221;221;221m [39m[38;2;221;221;221mgetAcceptTimeout[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;255;0;0mconst[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mreturn[39m[38;2;221;221;221m [39m[38;2;221;221;221m_acceptTimeout[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;0;255;0m// helper methods for logging[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221mtraits[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformattable[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m [39m[38;2;221;221;221mTs[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m [39m[38;2;221;221;221mlogMessage[39m[38;2;221;221;221m([39m[38;2;221;221;221mLoggerT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mloglevel_t[39m[38;2;221;221;221m [39m[38;2;221;221;221mlevel[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformat_string[39m[38;2;221;221;221m<[39m[38;2;221;221;221mTs[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;221;221;221mfmt[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mTs[39m[38;2;221;221;221m&[39m[38;2;221;221;221m&[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m [39m[38;2;221;221;221margs[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mLoggerT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mlogMessage[39m[38;2;221;221;221m([39m[38;2;221;221;221mlevel[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformat[39m[38;2;221;221;221m([39m[38;2;221;221;221mfmt[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mforward[39m[38;2;221;221;221m<[39m[38;2;221;221;221mTs[39m[38;2;221;221;221m>[39m[38;2;221;221;221m([39m[38;2;221;221;221margs[39m[38;2;221;221;221m)[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221mtraits[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformattable[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m [39m[38;2;221;221;221mTs[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m [39m[38;2;221;221;221mlogInfo[39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformat_string[39m[38;2;221;221;221m<[39m[38;2;221;221;221mTs[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;221;221;221mfmt[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mTs[39m[38;2;221;221;221m&[39m[38;2;221;221;221m&[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m [39m[38;2;221;221;221margs[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mLoggerT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mlogInfo[39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformat[39m[38;2;221;221;221m([39m[38;2;221;221;221mfmt[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mforward[39m[38;2;221;221;221m<[39m[38;2;221;221;221mTs[39m[38;2;221;221;221m>[39m[38;2;221;221;221m([39m[38;2;221;221;221margs[39m[38;2;221;221;221m)[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221mtraits[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformattable[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m [39m[38;2;221;221;221mTs[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m [39m[38;2;221;221;221mlogDebug[39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformat_string[39m[38;2;221;221;221m<[39m[38;2;221;221;221mTs[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;221;221;221mfmt[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mTs[39m[38;2;221;221;221m&[39m[38;2;221;221;221m&[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m [39m[38;2;221;221;221margs[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mLoggerT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mlogDebug[39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformat[39m[38;2;221;221;221m([39m[38;2;221;221;221mfmt[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mforward[39m[38;2;221;221;221m<[39m[38;2;221;221;221mTs[39m[38;2;221;221;221m>[39m[38;2;221;221;221m([39m[38;2;221;221;221margs[39m[38;2;221;221;221m)[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221mtraits[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformattable[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m [39m[38;2;221;221;221mTs[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m [39m[38;2;221;221;221mlogError[39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformat_string[39m[38;2;221;221;221m<[39m[38;2;221;221;221mTs[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;221;221;221mfmt[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mTs[39m[38;2;221;221;221m&[39m[38;2;221;221;221m&[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m [39m[38;2;221;221;221margs[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mLoggerT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mlogError[39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformat[39m[38;2;221;221;221m([39m[38;2;221;221;221mfmt[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mforward[39m[38;2;221;221;221m<[39m[38;2;221;221;221mTs[39m[38;2;221;221;221m>[39m[38;2;221;221;221m([39m[38;2;221;221;221margs[39m[38;2;221;221;221m)[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m.[39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221mprotected[39m[38;2;221;221;221m:[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mchrono[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mseconds[39m[38;2;221;221;221m [39m[38;2;221;221;221m_acceptTimeout[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mchrono[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mseconds[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmax[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;0;255;0m// template <interfaces::adc_netsession_c SessionT>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;0;255;0m// inline static std::unordered_map<const AdcGenericNetServer*, bool> _isListening{};[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221minterfaces[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221madc_netsession_c[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0minline[39m[38;2;221;221;221m [39m[38;2;255;0;0mstatic[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221munordered_map[39m[38;2;221;221;221m<[39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m*[39m[38;2;221;221;221m,[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221munordered_map[39m[38;2;221;221;221m<[39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mnetsession_ident_t[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;238;130;238mbool[39m[38;2;221;221;221m>[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_isListening[39m[38;2;221;221;221m{[39m[38;2;221;221;221m}[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mvector[39m[38;2;221;221;221m<[39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mfunction[39m[38;2;221;221;221m<[39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221m>[39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;221;221;221m_stopListenFunc[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mvector[39m[38;2;221;221;221m<[39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mfunction[39m[38;2;221;221;221m<[39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m([39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m*[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;255;0;0mconst[39m[38;2;221;221;221m [39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221m>[39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;221;221;221m_moveCtorFunc[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mserver_ident_t[39m[38;2;221;221;221m [39m[38;2;221;221;221m_serverIdent[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mAT[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mIDT[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mCTXT[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m [39m[38;2;221;221;221mdoAccept[39m[38;2;221;221;221m([39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mshared_ptr[39m[38;2;221;221;221m<[39m[38;2;221;221;221mAT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m [39m[38;2;221;221;221macceptor[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mIDT[39m[38;2;221;221;221m [39m[38;2;221;221;221mid[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mCTXT[39m[38;2;221;221;221m [39m[38;2;221;221;221msess_ctx[39m[38;2;221;221;221m)[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221macceptor[39m[38;2;221;221;221m-[39m[38;2;221;221;221m>[39m[38;2;221;221;221masyncAccept[39m[38;2;221;221;221m([39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m[[39m[38;2;221;221;221macceptor[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mid[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mid[39m[38;2;221;221;221m)[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221msess_ctx[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221msess_ctx[39m[38;2;221;221;221m)[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mthis[39m[38;2;221;221;221m][39m[38;2;221;221;221m([39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mauto[39m[38;2;221;221;221m [39m[38;2;221;221;221mec[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mnetservice_t[39m[38;2;221;221;221m [39m[38;2;221;221;221msrv[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221mmutable[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mif[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;221;221;221m![39m[38;2;221;221;221mec[39m[38;2;221;221;221m)[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mlogInfo[39m[38;2;221;221;221m([39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;135;206;235m"[39m[38;2;135;206;235mClient connection is succesfully accepted! Client endpoint: {} (server addr = {}, thread = [39m[38;2;135;206;235m"[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;135;206;235m"[39m[38;2;135;206;235m{})[39m[38;2;135;206;235m"[39m[38;2;221;221;221m,[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221msrv[39m[38;2;221;221;221m.[39m[38;2;221;221;221mremoteEndpoint[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221m([39m[38;2;238;130;238mvoid[39m[38;2;221;221;221m*[39m[38;2;221;221;221m)[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mutils[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mAdcThisThreadId[39m[38;2;221;221;221m([39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;255;0;0mauto[39m[38;2;221;221;221m [39m[38;2;221;221;221msess[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmake_shared[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m([39m[38;2;221;221;221mid[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221msrv[39m[38;2;221;221;221m)[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221msess_ctx[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mstartSession[39m[38;2;221;221;221m([39m[38;2;221;221;221msess[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_isListening[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m][39m[38;2;221;221;221m[[39m[38;2;221;221;221mid[39m[38;2;221;221;221m][39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mtrue[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mdoAccept[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m([39m[38;2;221;221;221macceptor[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221mid[39m[38;2;221;221;221m)[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mmove[39m[38;2;221;221;221m([39m[38;2;221;221;221msess_ctx[39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m [39m[38;2;255;0;0melse[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mthis[39m[38;2;221;221;221m-[39m[38;2;221;221;221m>[39m[38;2;221;221;221mlogError[39m[38;2;221;221;221m([39m[38;2;135;206;235m"[39m[38;2;135;206;235mCannot start accepting connection: {}[39m[38;2;135;206;235m"[39m[38;2;221;221;221m,[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mnetservice_t[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mformattableError[39m[38;2;221;221;221m([39m[38;2;221;221;221mec[39m[38;2;221;221;221m)[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_isListening[39m[38;2;221;221;221m<[39m[38;2;221;221;221mSessionT[39m[38;2;221;221;221m>[39m[38;2;221;221;221m[[39m[38;2;221;221;221mthis[39m[38;2;221;221;221m][39m[38;2;221;221;221m[[39m[38;2;221;221;221mid[39m[38;2;221;221;221m][39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mfalse[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m[38;2;221;221;221m,[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m_acceptTimeout[39m[38;2;221;221;221m)[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221m}[39m
|
||||||
|
[38;2;221;221;221m}[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;221;221;221mnamespace[39m[38;2;221;221;221m [39m[38;2;221;221;221minterfaces[39m
|
||||||
|
[38;2;221;221;221m{[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221mtemplate[39m[38;2;221;221;221m [39m[38;2;221;221;221m<[39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mT[39m[38;2;221;221;221m>[39m
|
||||||
|
[38;2;221;221;221mconcept[39m[38;2;221;221;221m [39m[38;2;221;221;221madc_generic_netserver_c[39m[38;2;221;221;221m [39m[38;2;221;221;221m=[39m[38;2;221;221;221m [39m[38;2;221;221;221mrequires[39m[38;2;221;221;221m [39m[38;2;221;221;221m{[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mserver_ident_t[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m [39m[38;2;221;221;221mrequires[39m[38;2;221;221;221m [39m[38;2;221;221;221mstd[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mderived_from[39m[38;2;221;221;221m<[39m[38;2;221;221;221mT[39m[38;2;221;221;221m,[39m[38;2;221;221;221m [39m[38;2;221;221;221madc[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mAdcGenericNetServer[39m[38;2;221;221;221m<[39m[38;2;221;221;221mtypename[39m[38;2;221;221;221m [39m[38;2;221;221;221mT[39m[38;2;221;221;221m:[39m[38;2;221;221;221m:[39m[38;2;221;221;221mserver_ident_t[39m[38;2;221;221;221m>[39m[38;2;221;221;221m>[39m[38;2;221;221;221m;[39m
|
||||||
|
[38;2;221;221;221m}[39m[38;2;221;221;221m;[39m
|
||||||
|
|
||||||
|
[38;2;221;221;221m}[39m[38;2;221;221;221m [39m[38;2;0;255;0m// namespace interfaces[39m
|
||||||
|
|
||||||
|
|
||||||
|
[38;2;221;221;221m}[39m[38;2;221;221;221m [39m[38;2;0;255;0m// namespace adc[39m
|
||||||
Reference in New Issue
Block a user