sendpack qui fonctionne avec le client

This commit is contained in:
MarcEricMartel
2023-10-23 16:20:52 -04:00
parent 590220bc92
commit 49240635b6
3 changed files with 19 additions and 9 deletions

View File

@@ -116,5 +116,15 @@ namespace netprot {
bool Deserialize(ErrorLog* errlog, char* buf, const uint32_t buflen); // srv
PacketType getType(char* buf, uint32_t buflen); // srv/cli
}
template <class T> void sendPack(SOCKET sock, T* pack, char** buf, uint32_t* buflen);
template <class T>
void sendPack(SOCKET sock, T* pack, char** buf, uint32_t* buflen) {
netprot::Serialize(pack, buf, buflen);
send(sock, *buf, *buflen, 0);
*buflen = BUFFER_LENGTH;
}
};
#endif