picloud ping and fix big bugs

This commit is contained in:
2021-08-19 18:13:05 +03:00
parent f5af8a1da9
commit 4c0530d89a
13 changed files with 58 additions and 30 deletions

View File

@@ -87,7 +87,7 @@ int PICloud::TCP::sendData(const PIByteArray & data) {
PIByteArray ba;
ba << header;
ba.append(data);
// piCout << "sendData" << ba.toHex();
// piCout << "[PICloud::TCP] sendData" << ba.toHex();
streampacker->send(ba);
return data.size_s();
}
@@ -103,6 +103,15 @@ int PICloud::TCP::sendData(const PIByteArray & data, uint client_id) {
}
void PICloud::TCP::sendPing() {
header.type = PICloud::TCP::Ping;
PIByteArray ba;
ba << header;
ba.append(suuid);
streampacker->send(ba);
}
PIPair<PICloud::TCP::Type, PICloud::TCP::Role> PICloud::TCP::parseHeader(PIByteArray & ba) {
PIPair<PICloud::TCP::Type, PICloud::TCP::Role> ret;
ret.first = InvalidType;