From f5aa7827af55342a1ec714d366944b3e3f3129b2 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Wed, 21 Jun 2017 19:26:25 +0500 Subject: 2017-06-21 --- include/network/NetworkClient.hpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 include/network/NetworkClient.hpp (limited to 'include/network/NetworkClient.hpp') diff --git a/include/network/NetworkClient.hpp b/include/network/NetworkClient.hpp new file mode 100644 index 0000000..22b1b22 --- /dev/null +++ b/include/network/NetworkClient.hpp @@ -0,0 +1,26 @@ +#pragma once + +#include +#include +#include + +#include + +class NetworkClient { + Network network; + std::thread networkThread; + std::mutex toSendMutex; + std::mutex toReceiveMutex; + std::queue > toSend; + std::queue > toReceive; + bool isActive=true; + bool &isRunning; + ConnectionState state; + void NetworkLoop(); +public: + NetworkClient(std::string address, unsigned short port, std::string username, bool &quit); + ~NetworkClient(); + + std::shared_ptr ReceivePacket(); + void SendPacket(std::shared_ptr packet); +}; \ No newline at end of file -- cgit v1.2.3