Got async methods working for send in TcpClientWindows
All SendMessage functions are now void
This commit is contained in:
@ -30,20 +30,15 @@ public:
|
||||
|
||||
NetworkBuffer ReceiveDataArray();
|
||||
const NetworkMessage &ReceiveData();
|
||||
void StartSender();
|
||||
VoidCode SendMessage(const NetworkMessage &message);
|
||||
void SendMessage(const NetworkMessage &message);
|
||||
|
||||
private:
|
||||
void SendNetworkMessage(const NetworkMessage &message);
|
||||
void SendNetworkMessageNow(const NetworkMessage &message);
|
||||
static void SendNetworkMessage(const NetworkMessage &message, TcpClient *client);
|
||||
VoidCode Initialize(const std::string &ip, uint16 port = default_port);
|
||||
|
||||
std::string ip;
|
||||
uint16 port = 0;
|
||||
bool initialized = false;
|
||||
bool run_sender = false;
|
||||
|
||||
std::vector<NetworkMessage> network_message_queue;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
SOCKET tcp_socket = INVALID_SOCKET;
|
||||
|
||||
@ -22,13 +22,13 @@ struct VoidNetClientAPI
|
||||
static bool Connect(const std::string &ip, uint16 port = default_port);
|
||||
static void Disconnect();
|
||||
|
||||
static bool SendMessageToServer(byte tag, byte subject, void *data);
|
||||
static bool SendMessageToID(uint16 id, byte tag, byte subject, void *data);
|
||||
static bool SendMessageToOthers(byte tag, byte subject, void *data);
|
||||
static bool SendMessageToAll(byte tag, byte subject, void *data);
|
||||
static bool SendMessageToAllAndMe(byte tag, byte subject, void *data);
|
||||
static void SendMessageToServer(byte tag, byte subject, void *data);
|
||||
static void SendMessageToID(uint16 id, byte tag, byte subject, void *data);
|
||||
static void SendMessageToOthers(byte tag, byte subject, void *data);
|
||||
static void SendMessageToAll(byte tag, byte subject, void *data);
|
||||
static void SendMessageToAllAndMe(byte tag, byte subject, void *data);
|
||||
|
||||
static bool SendMessage(byte distribution_mode, uint16 destination_id, byte tag, byte subject, void *data);
|
||||
static void SendMessage(byte distribution_mode, uint16 destination_id, byte tag, byte subject, void *data);
|
||||
|
||||
static void Receive();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user