Add check if connected and remove block list and removing of old data.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user