.. _program_listing_file_sockets_include_sockets_sockets.hpp: Program Listing for File sockets.hpp ==================================== |exhale_lsh| :ref:`Return to documentation for file ` (``sockets/include/sockets/sockets.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include #include #include "detail/address_family.hpp" #include "detail/address_info.hpp" #include "detail/byte_order.hpp" #include "detail/message_buffer.hpp" #include "detail/socket.hpp" namespace c2k { class Sockets final { private: Sockets(); public: Sockets(Sockets const& other) = delete; Sockets(Sockets&& other) noexcept = delete; Sockets& operator=(Sockets const& other) = delete; Sockets& operator=(Sockets&& other) noexcept = delete; ~Sockets(); [[nodiscard]] static ServerSocket create_server( AddressFamily const address_family, std::uint16_t const port, std::function callback, [[maybe_unused]] Sockets const& key = instance() ) { return ServerSocket{ address_family, port, std::move(callback) }; } [[nodiscard]] static ClientSocket create_client( AddressFamily address_family, std::string const& host, std::uint16_t port, [[maybe_unused]] Sockets const& key = instance() ); private: [[nodiscard]] static Sockets const& instance(); }; } // namespace c2k