Add check if connected and remove block list and removing of old data.

This commit is contained in:
2025-06-18 17:47:40 +02:00
parent 1516ad63cb
commit 31e8f302ac
5 changed files with 25 additions and 9 deletions

View File

@@ -161,6 +161,20 @@ void DnaStore::sync()
t.detach();
}
bool DnaStore::ping(){
int sock = TcpSocket::connectt(HOST_NAME, keyPort);
if (sock < 0)
{
return false;
}
int64_t header = 0;
TcpSocket::recvt(sock, &header, sizeof(header));
TcpSocket::closet(sock);
return header == StartHeader;
}
void client(std::string_view prefix)
{
constexpr int extra_buff = 22; // len of 2**31 -> 2147483648 plus the pattern size