From e2a4adec64f4edf18fb7bbcff60775d02e096ccb Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 27 Jul 2024 08:48:52 -0400 Subject: [PATCH] updated to use new WC repo --- CMakeLists.txt | 18 ++++++++++--- src/executable/3_packets/main.cpp | 2 +- src/library/network/CMakeLists.txt | 2 ++ src/library/network/ip/ip_address.h | 2 ++ src/library/network/ip/port_id.h | 4 +++ src/library/network/ip/socket_address.h | 1 + .../network_interface_name.h | 1 + .../virtual_network_interface.cpp | 8 +++--- .../virtual_network_interface.h | 7 +++-- src/library/network/packet/packet.h | 12 +++++++++ src/library/network/socket/active_socket.cpp | 12 ++++----- src/library/network/socket/active_socket.h | 16 ++++++----- src/library/network/socket/passive_socket.cpp | 2 +- src/library/network/socket/passive_socket.h | 8 +++++- .../socket/private/active_socket_impl.cpp | 27 ++++++++++--------- .../socket/private/active_socket_impl.h | 19 +++++++------ .../socket/private/passive_socket_impl.cpp | 2 +- .../socket/private/passive_socket_impl.h | 8 +++--- .../socket/private/socket_base_impl.cpp | 12 ++++----- .../network/socket/private/socket_base_impl.h | 12 ++++++--- src/library/network/socket/socket_id.h | 1 + 21 files changed, 115 insertions(+), 61 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3d7f0b..841df5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16.3) +cmake_minimum_required(VERSION 3.5) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) @@ -14,12 +14,16 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug") add_compile_options( -g -O0 + -Wall + -fPIE -march=native ) else() add_compile_options( -O3 -march=native + -Wall + -fPIE -g ) endif() @@ -59,14 +63,20 @@ include("${_scripts_src_path}/cmake/fetch_dependencies.cmake") fetch_dependency("https://github.com/buildingcpp/include.git;main") fetch_dependency("https://github.com/buildingcpp/system.git;main") +set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) +set(WORK_CONTRACT_BUILD_BENCHMARK OFF) +fetch_dependency("https://github.com/buildingcpp/work_contract.git;main") + option(NETWORK_BUILD_DEMO "Build examples" ON) option(NETWORK_BUILD_TEST "Build tests" ON) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME}) set(_${PROJECT_NAME}_dir ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "") + add_subdirectory(src) -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) diff --git a/src/executable/3_packets/main.cpp b/src/executable/3_packets/main.cpp index c7c0725..a17f37a 100755 --- a/src/executable/3_packets/main.cpp +++ b/src/executable/3_packets/main.cpp @@ -76,7 +76,7 @@ namespace example_2 // a toy allocator static auto constexpr buffer_size = 2048; static auto constexpr allocator_capacity = 4; - using buffer = char[buffer_size]; + static std::vector pool(allocator_capacity); static std::vector avail; for (auto i = 0; i < allocator_capacity; ++i) diff --git a/src/library/network/CMakeLists.txt b/src/library/network/CMakeLists.txt index 7b9e131..5a8fd30 100644 --- a/src/library/network/CMakeLists.txt +++ b/src/library/network/CMakeLists.txt @@ -21,6 +21,7 @@ target_link_libraries(network PUBLIC include system + work_contract ) if (USE_KQUEUE) @@ -32,6 +33,7 @@ target_include_directories(network ${_include_dir}/src ${_system_dir}/src ${_network_dir}/src + ${_work_contract_dir}/src ${_fmt_src_path}/include /usr/include/kqueue/ ) diff --git a/src/library/network/ip/ip_address.h b/src/library/network/ip/ip_address.h index f8bc11a..18cc418 100644 --- a/src/library/network/ip/ip_address.h +++ b/src/library/network/ip/ip_address.h @@ -72,6 +72,7 @@ namespace bcpp::network //========================================================================= + [[maybe_unused]] static std::string to_string ( ip_address ipAddress @@ -89,6 +90,7 @@ namespace bcpp::network //============================================================================= +[[maybe_unused]] static std::ostream & operator << ( std::ostream & stream, diff --git a/src/library/network/ip/port_id.h b/src/library/network/ip/port_id.h index 3c29c71..44a4de7 100644 --- a/src/library/network/ip/port_id.h +++ b/src/library/network/ip/port_id.h @@ -45,6 +45,7 @@ namespace bcpp::network //========================================================================= + [[maybe_unused]] static port_id byte_swap ( port_id source @@ -55,6 +56,7 @@ namespace bcpp::network //========================================================================= + [[maybe_unused]] static std::string to_string ( port_id portId @@ -66,6 +68,7 @@ namespace bcpp::network namespace literals { + [[maybe_unused]] static constexpr port_id operator""_port(unsigned long long int value){return port_id(value);} } @@ -73,6 +76,7 @@ namespace bcpp::network //============================================================================= +[[maybe_unused]] static std::ostream & operator << ( std::ostream & stream, diff --git a/src/library/network/ip/socket_address.h b/src/library/network/ip/socket_address.h index 66324e8..c0c4762 100644 --- a/src/library/network/ip/socket_address.h +++ b/src/library/network/ip/socket_address.h @@ -134,6 +134,7 @@ constexpr bcpp::network::socket_address::socket_address //============================================================================= +[[maybe_unused]] static std::ostream & operator << ( std::ostream & stream, diff --git a/src/library/network/network_interface/network_interface_name.h b/src/library/network/network_interface/network_interface_name.h index 26fc800..7e553ef 100644 --- a/src/library/network/network_interface/network_interface_name.h +++ b/src/library/network/network_interface/network_interface_name.h @@ -52,6 +52,7 @@ namespace bcpp::network //============================================================================= +[[maybe_unused]] static std::ostream & operator << ( std::ostream & stream, diff --git a/src/library/network/network_interface/virtual_network_interface.cpp b/src/library/network/network_interface/virtual_network_interface.cpp index 77b8b11..3ef2d1e 100644 --- a/src/library/network/network_interface/virtual_network_interface.cpp +++ b/src/library/network/network_interface/virtual_network_interface.cpp @@ -13,8 +13,8 @@ bcpp::network::virtual_network_interface::virtual_network_interface { networkInterfaceConfiguration_.ipAddress_ = in_addr_any; poller_ = poller_->create({}); - sendWorkContractGroup_ = std::make_unique(default_capacity); - receiveWorkContractGroup_ = std::make_unique(default_capacity); + sendWorkContractGroup_ = std::make_unique(default_capacity); + receiveWorkContractGroup_ = std::make_unique(default_capacity); stopped_ = false; } @@ -29,8 +29,8 @@ bcpp::network::virtual_network_interface::virtual_network_interface if (networkInterfaceConfiguration_.ipAddress_.is_valid()) { poller_ = poller_->create(config.poller_); - sendWorkContractGroup_ = std::make_unique(config.capacity_); - receiveWorkContractGroup_ = std::make_unique(config.capacity_); + sendWorkContractGroup_ = std::make_unique(config.capacity_); + receiveWorkContractGroup_ = std::make_unique(config.capacity_); stopped_ = false; } } diff --git a/src/library/network/network_interface/virtual_network_interface.h b/src/library/network/network_interface/virtual_network_interface.h index cc583f0..1a3b9f5 100644 --- a/src/library/network/network_interface/virtual_network_interface.h +++ b/src/library/network/network_interface/virtual_network_interface.h @@ -118,6 +118,9 @@ namespace bcpp::network private: + using work_contract_tree_type = work_contract_tree; // really we want blocking here but that implementation needs to be restored + using work_contract_type = work_contract; // really we want blocking here but that implementation needs to be restored + template P open_socket ( @@ -128,8 +131,8 @@ namespace bcpp::network network_interface_configuration networkInterfaceConfiguration_; std::shared_ptr poller_; - std::unique_ptr sendWorkContractGroup_; - std::unique_ptr receiveWorkContractGroup_; + std::unique_ptr sendWorkContractGroup_; + std::unique_ptr receiveWorkContractGroup_; std::atomic stopped_{true}; diff --git a/src/library/network/packet/packet.h b/src/library/network/packet/packet.h index 086a1ff..cb79dbc 100644 --- a/src/library/network/packet/packet.h +++ b/src/library/network/packet/packet.h @@ -78,6 +78,8 @@ namespace bcpp::network operator std::span() const; + operator bool() const; + private: void release(); @@ -95,6 +97,7 @@ namespace bcpp::network namespace literals { + [[maybe_unused]] static packet operator""_packet(char const * addr, std::size_t len){return packet({addr, len});} } @@ -286,6 +289,15 @@ inline void bcpp::network::packet::release } +//============================================================================= +inline bcpp::network::packet::operator bool +( +) const +{ + return (buffer_.size() > 0); +} + + //============================================================================= inline bcpp::network::packet::operator std::span ( diff --git a/src/library/network/socket/active_socket.cpp b/src/library/network/socket/active_socket.cpp index 0aab6ad..1c0a60b 100644 --- a/src/library/network/socket/active_socket.cpp +++ b/src/library/network/socket/active_socket.cpp @@ -9,8 +9,8 @@ bcpp::network::active_socket

::socket socket_address socketAddress, configuration const & config, event_handlers const & eventHandlers, - system::blocking_work_contract_group & sendWorkContractGroup, - system::blocking_work_contract_group & receiveWorkContractGroup, + work_contract_tree_type & sendWorkContractGroup, + work_contract_tree_type & receiveWorkContractGroup, std::shared_ptr & p ) requires (udp_concept

) try @@ -49,8 +49,8 @@ bcpp::network::active_socket

::socket ip_address ipAddress, configuration const & config, event_handlers const & eventHandlers, - system::blocking_work_contract_group & sendWorkContractGroup, - system::blocking_work_contract_group & receiveWorkContractGroup, + work_contract_tree_type & sendWorkContractGroup, + work_contract_tree_type & receiveWorkContractGroup, std::shared_ptr & p ) requires (tcp_concept

) try @@ -89,8 +89,8 @@ bcpp::network::active_socket

::socket system::file_descriptor fileDescriptor, configuration const & config, event_handlers const & eventHandlers, - system::blocking_work_contract_group & sendWorkContractGroup, - system::blocking_work_contract_group & recevieWorkContractGroup, + work_contract_tree_type & sendWorkContractGroup, + work_contract_tree_type & recevieWorkContractGroup, std::shared_ptr & p ) requires (tcp_concept

) try diff --git a/src/library/network/socket/active_socket.h b/src/library/network/socket/active_socket.h index 1731260..fde605f 100644 --- a/src/library/network/socket/active_socket.h +++ b/src/library/network/socket/active_socket.h @@ -6,6 +6,7 @@ #include "./connect_result.h" #include +#include #include #include #include @@ -30,6 +31,9 @@ namespace bcpp::network { public: + using work_contract_tree_type = work_contract_tree; // really we want blocking here but that implementation needs to be restored + using work_contract_type = work_contract; // really we want blocking here but that implementation needs to be restored + using traits = active_socket_traits

; struct event_handlers @@ -72,8 +76,8 @@ namespace bcpp::network socket_address, configuration const &, event_handlers const &, - system::blocking_work_contract_group &, - system::blocking_work_contract_group &, + work_contract_tree_type &, + work_contract_tree_type &, std::shared_ptr & ) requires (udp_concept

); @@ -82,8 +86,8 @@ namespace bcpp::network ip_address, configuration const &, event_handlers const &, - system::blocking_work_contract_group &, - system::blocking_work_contract_group &, + work_contract_tree_type &, + work_contract_tree_type &, std::shared_ptr & ) requires (tcp_concept

); @@ -92,8 +96,8 @@ namespace bcpp::network system::file_descriptor, configuration const &, event_handlers const &, - system::blocking_work_contract_group &, - system::blocking_work_contract_group &, + work_contract_tree_type &, + work_contract_tree_type &, std::shared_ptr & ) requires (tcp_concept

); diff --git a/src/library/network/socket/passive_socket.cpp b/src/library/network/socket/passive_socket.cpp index 49043c3..4f95315 100644 --- a/src/library/network/socket/passive_socket.cpp +++ b/src/library/network/socket/passive_socket.cpp @@ -8,7 +8,7 @@ bcpp::network::passive_socket::socket socket_address socketAddress, configuration const & config, event_handlers const & eventHandlers, - system::blocking_work_contract_group & workContractGroup, + work_contract_tree_type & workContractGroup, std::shared_ptr & p ) try diff --git a/src/library/network/socket/passive_socket.h b/src/library/network/socket/passive_socket.h index 17a4151..e561996 100644 --- a/src/library/network/socket/passive_socket.h +++ b/src/library/network/socket/passive_socket.h @@ -2,10 +2,13 @@ #include "./socket.h" #include "./traits/traits.h" + #include + #include #include +#include #include #include @@ -22,6 +25,9 @@ namespace bcpp::network { public: + using work_contract_tree_type = work_contract_tree; // really we want blocking here but that implementation needs to be restored + using work_contract_type = work_contract; // really we want blocking here but that implementation needs to be restored + using traits = tcp_listener_socket_traits; static auto constexpr default_backlog{128}; @@ -55,7 +61,7 @@ namespace bcpp::network socket_address, configuration const &, event_handlers const &, - system::blocking_work_contract_group &, + work_contract_tree_type &, std::shared_ptr & ); diff --git a/src/library/network/socket/private/active_socket_impl.cpp b/src/library/network/socket/private/active_socket_impl.cpp index 9d15d05..63078bb 100644 --- a/src/library/network/socket/private/active_socket_impl.cpp +++ b/src/library/network/socket/private/active_socket_impl.cpp @@ -24,8 +24,8 @@ bcpp::network::active_socket_impl

::socket_impl socket_address socketAddress, configuration const & config, event_handlers const & eventHandlers, - system::blocking_work_contract_group & sendWorkContractGroup, - system::blocking_work_contract_group & receiveWorkContractGroup, + work_contract_tree_type & sendWorkContractGroup, + work_contract_tree_type & receiveWorkContractGroup, std::shared_ptr const & p ) : socket_base_impl(socketAddress, {.ioMode_ = config.ioMode_}, eventHandlers, @@ -68,8 +68,8 @@ bcpp::network::active_socket_impl

::socket_impl system::file_descriptor fileDescriptor, configuration const & config, event_handlers const & eventHandlers, - system::blocking_work_contract_group & sendWorkContractGroup, - system::blocking_work_contract_group & receiveWorkContractGroup, + work_contract_tree_type & sendWorkContractGroup, + work_contract_tree_type & receiveWorkContractGroup, std::shared_ptr const & p ) requires (tcp_concept

) : socket_base_impl({.ioMode_ = config.ioMode_}, eventHandlers, std::move(fileDescriptor), @@ -336,11 +336,12 @@ void bcpp::network::active_socket_impl

::receive ( ) requires (tcp_concept

) { - packet buffer = packetAllocationHandler_(id_, readBufferSize_); - if (auto bytesReceived = ::recv(fileDescriptor_.get(), buffer.data(), buffer.capacity(), 0); bytesReceived > 0) + if (!pendingReceivePacket_) + pendingReceivePacket_ = std::move(packetAllocationHandler_(id_, readBufferSize_)); + if (auto bytesReceived = ::recv(fileDescriptor_.get(), pendingReceivePacket_.data(), pendingReceivePacket_.capacity(), 0); bytesReceived > 0) { - buffer.resize(bytesReceived); - receiveHandler_(id_, std::move(buffer), peerSocketAddress_); + pendingReceivePacket_.resize(bytesReceived); + receiveHandler_(id_, std::move(pendingReceivePacket_), peerSocketAddress_); if (get_bytes_available() > 0) on_polled(); // there is more data so reschedule the work contract return; @@ -371,13 +372,13 @@ void bcpp::network::active_socket_impl

::receive { ::sockaddr_in sockAddrIn; ::socklen_t addressLength = sizeof(sockAddrIn); - - packet buffer = packetAllocationHandler_(id_, readBufferSize_); - if (auto bytesReceived = ::recvfrom(fileDescriptor_.get(), buffer.data(), buffer.capacity(), 0, + if (!pendingReceivePacket_) + pendingReceivePacket_ = std::move(packetAllocationHandler_(id_, readBufferSize_)); + if (auto bytesReceived = ::recvfrom(fileDescriptor_.get(), pendingReceivePacket_.data(), pendingReceivePacket_.capacity(), 0, reinterpret_cast<::sockaddr *>(&sockAddrIn), &addressLength); bytesReceived >= 0) { - buffer.resize(bytesReceived); - receiveHandler_(id_, std::move(buffer), sockAddrIn); + pendingReceivePacket_.resize(bytesReceived); + receiveHandler_(id_, std::move(pendingReceivePacket_), sockAddrIn); on_polled(); // there could be more ... } else diff --git a/src/library/network/socket/private/active_socket_impl.h b/src/library/network/socket/private/active_socket_impl.h index 2489f96..81fad50 100644 --- a/src/library/network/socket/private/active_socket_impl.h +++ b/src/library/network/socket/private/active_socket_impl.h @@ -26,6 +26,7 @@ namespace bcpp::network { public: + using traits = socket_traits; struct event_handlers : socket_base_impl::event_handlers @@ -63,8 +64,8 @@ namespace bcpp::network socket_address, configuration const &, event_handlers const &, - system::blocking_work_contract_group &, - system::blocking_work_contract_group &, + work_contract_tree_type &, + work_contract_tree_type &, std::shared_ptr const & ); @@ -73,8 +74,8 @@ namespace bcpp::network system::file_descriptor, configuration const &, event_handlers const &, - system::blocking_work_contract_group &, - system::blocking_work_contract_group &, + work_contract_tree_type &, + work_contract_tree_type &, std::shared_ptr const & ) requires (tcp_concept

); @@ -162,14 +163,16 @@ namespace bcpp::network send_info(send_info &&) = default; send_info & operator = (send_info &&) = default; - packet packet_; - send_completion_token sendToken_; - socket_address destination_; + packet packet_; + send_completion_token sendToken_; + socket_address destination_; }; spsc_fixed_queue sendQueue_; - system::blocking_work_contract sendContract_; + work_contract_type sendContract_; + + packet pendingReceivePacket_; }; // class socket_impl> diff --git a/src/library/network/socket/private/passive_socket_impl.cpp b/src/library/network/socket/private/passive_socket_impl.cpp index 0d000d9..4969c27 100644 --- a/src/library/network/socket/private/passive_socket_impl.cpp +++ b/src/library/network/socket/private/passive_socket_impl.cpp @@ -7,7 +7,7 @@ bcpp::network::passive_socket_impl::socket_impl socket_address socketAddress, configuration const & config, event_handlers const & eventHandlers, - system::blocking_work_contract_group & workContractGroup, + work_contract_tree_type & workContractGroup, std::shared_ptr & p ) : socket_base_impl(socketAddress, {.ioMode_ = config.ioMode_}, eventHandlers, ::socket(PF_INET, SOCK_STREAM, IPPROTO_TCP), diff --git a/src/library/network/socket/private/passive_socket_impl.h b/src/library/network/socket/private/passive_socket_impl.h index bd4f2a7..1d6651b 100644 --- a/src/library/network/socket/private/passive_socket_impl.h +++ b/src/library/network/socket/private/passive_socket_impl.h @@ -31,9 +31,9 @@ namespace bcpp::network struct configuration { - system::synchronization_mode synchronicityMode_{system::synchronization_mode::non_blocking}; - std::uint32_t backlog_{1024}; - system::io_mode ioMode_{system::io_mode::read_write}; + synchronization_mode synchronicityMode_{synchronization_mode::non_blocking}; + std::uint32_t backlog_{1024}; + system::io_mode ioMode_{system::io_mode::read_write}; }; socket_impl @@ -41,7 +41,7 @@ namespace bcpp::network socket_address, configuration const &, event_handlers const &, - system::blocking_work_contract_group &, + work_contract_tree_type &, std::shared_ptr & ); diff --git a/src/library/network/socket/private/socket_base_impl.cpp b/src/library/network/socket/private/socket_base_impl.cpp index d5e8730..50a8e7a 100644 --- a/src/library/network/socket/private/socket_base_impl.cpp +++ b/src/library/network/socket/private/socket_base_impl.cpp @@ -21,7 +21,7 @@ bcpp::network::socket_base_impl::socket_base_impl configuration const & config, event_handlers const & eventHandlers, system::file_descriptor fileDescriptor, - system::blocking_work_contract workContract + work_contract_type workContract ) try : fileDescriptor_(std::move(fileDescriptor)), closeHandler_(eventHandlers.closeHandler_), @@ -35,7 +35,7 @@ bcpp::network::socket_base_impl::socket_base_impl bind(socketAddress); socketAddress_ = get_socket_name(); } - if (auto success = set_synchronicity(system::synchronization_mode::non_blocking); !success) + if (auto success = set_synchronicity(synchronization_mode::non_blocking); !success) throw std::runtime_error("set non_blocking failure"); if (auto success = set_io_mode(config.ioMode_); !success) throw std::runtime_error("set_io_mode failure"); @@ -56,7 +56,7 @@ bcpp::network::socket_base_impl::socket_base_impl configuration const & config, event_handlers const & eventHandlers, system::file_descriptor fileDescriptor, - system::blocking_work_contract workContract + work_contract_type workContract ) try : fileDescriptor_(std::move(fileDescriptor)), closeHandler_(eventHandlers.closeHandler_), @@ -65,7 +65,7 @@ bcpp::network::socket_base_impl::socket_base_impl { if (set_socket_option(SOL_SOCKET, SO_REUSEADDR, 1) != 0) throw std::runtime_error("reuse address failure"); - if (auto success = set_synchronicity(system::synchronization_mode::non_blocking); !success) + if (auto success = set_synchronicity(synchronization_mode::non_blocking); !success) throw std::runtime_error("set non_blocking failure"); if (auto success = set_io_mode(config.ioMode_); !success) throw std::runtime_error("set_io_mode failure"); @@ -203,13 +203,13 @@ auto bcpp::network::socket_base_impl::get_id //============================================================================= bool bcpp::network::socket_base_impl::set_synchronicity ( - system::synchronization_mode mode + synchronization_mode mode ) noexcept { auto flags = ::fcntl(fileDescriptor_.get(), F_GETFL, 0); if (flags == -1) return false; - if (mode == system::synchronization_mode::blocking) + if (mode == synchronization_mode::blocking) { // synchronous/blocking mode flags &= ~O_NONBLOCK; diff --git a/src/library/network/socket/private/socket_base_impl.h b/src/library/network/socket/private/socket_base_impl.h index 9fc7857..4d3f10a 100644 --- a/src/library/network/socket/private/socket_base_impl.h +++ b/src/library/network/socket/private/socket_base_impl.h @@ -9,6 +9,7 @@ #include #include +#include #include #include @@ -26,6 +27,9 @@ namespace bcpp::network { public: + using work_contract_tree_type = work_contract_tree; // really we want blocking here but that implementation needs to be restored + using work_contract_type = work_contract; // really we want blocking here but that implementation needs to be restored + struct event_handlers { using close_handler = std::function; @@ -45,7 +49,7 @@ namespace bcpp::network configuration const &, event_handlers const &, system::file_descriptor, - system::blocking_work_contract + work_contract_type ); socket_base_impl @@ -54,7 +58,7 @@ namespace bcpp::network configuration const &, event_handlers const &, system::file_descriptor, - system::blocking_work_contract + work_contract_type ); virtual ~socket_base_impl(); @@ -105,7 +109,7 @@ namespace bcpp::network bool set_synchronicity ( - system::synchronization_mode + synchronization_mode ) noexcept; bool shutdown @@ -134,7 +138,7 @@ namespace bcpp::network event_handlers::poll_error_handler pollErrorHandler_; - system::blocking_work_contract receiveContract_; + work_contract_type receiveContract_; }; // class socket_base_impl diff --git a/src/library/network/socket/socket_id.h b/src/library/network/socket/socket_id.h index 497194a..8c36ad7 100644 --- a/src/library/network/socket/socket_id.h +++ b/src/library/network/socket/socket_id.h @@ -40,6 +40,7 @@ namespace bcpp::network //============================================================================= +[[maybe_unused]] static std::ostream & operator << ( std::ostream & stream,