.. _program_listing_file_gui_Network_Network.hpp: Program Listing for File Network.hpp ==================================== |exhale_lsh| :ref:`Return to documentation for file ` (``gui/Network/Network.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include #include #include #include "API/API.hpp" #include #include #include class Network { private: int _port; const std::string _hostname; sockaddr_in serverAddr; int _fdServer; std::shared_ptr _api = nullptr; std::thread _networkThread; std::array _pipeFdExit; std::array _pollInFd; std::array _pollOutFd; void RunNetworkInternal(); void ServerHandshake(); public: Network(int port, std::string hostname, std::shared_ptr &data); ~Network(); void Run(); void SendMessage(const std::string &msg); [[nodiscard]] std::string ReceiveMessage() const; void RequestStop(); };