Added Development information for me to dont forget things xD
Added AllAndMe DistributionType Added a ThreadPool class Added VoidNetClientAPI
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
|
||||
#include "Defs.hpp"
|
||||
#include "NetworkMessage.hpp"
|
||||
#include "ThreadPool.hpp"
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -10,6 +11,8 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#undef SendMessage
|
||||
|
||||
class TcpClient
|
||||
{
|
||||
public:
|
||||
@ -27,21 +30,30 @@ public:
|
||||
|
||||
NetworkBuffer ReceiveDataArray();
|
||||
const NetworkMessage &ReceiveData();
|
||||
bool SendData(const NetworkMessage &message);
|
||||
VoidCode SendMessage(const NetworkMessage &message);
|
||||
|
||||
private:
|
||||
static VoidCode SendNetworkMessage(const NetworkMessage &message, TcpClient *client);
|
||||
VoidCode Initialize(const std::string &ip, uint16 port = default_port);
|
||||
|
||||
std::string ip;
|
||||
uint16 port = 0;
|
||||
bool initialized;
|
||||
|
||||
ThreadPool thread_pool;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
SOCKET socket = INVALID_SOCKET;
|
||||
SOCKET tcp_socket = INVALID_SOCKET;
|
||||
struct addrinfo *result = nullptr;
|
||||
struct addrinfo *ptr = nullptr;
|
||||
struct addrinfo hints;
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef UNICODE
|
||||
#define SendMessage SendMessageW
|
||||
#else
|
||||
#define SendMessage SendMessageA
|
||||
#endif // !UNICODE
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user