fix: supprot PING/PONG
This commit is contained in:
@@ -25,10 +25,11 @@ RedisSession::startReceive()
|
||||
auto self = weak_self.lock();
|
||||
if (!self) { return; }
|
||||
if (!ec) {
|
||||
auto sent = _socket.send(asio::buffer("+PONG\r\n"));
|
||||
LOGI("sent to {}:{} 7 bytes", _socket.remote_endpoint().address().to_string(),
|
||||
_socket.remote_endpoint().port());
|
||||
OnClose();
|
||||
std::string recv(_recv_buf.data(), received);
|
||||
if (recv == "*1\r\n$4\r\nPING\r\n") {
|
||||
auto sent = _socket.send(asio::buffer("+PONG\r\n"));
|
||||
OnClose();
|
||||
}
|
||||
} else {
|
||||
startReceive();
|
||||
}
|
||||
|
Reference in New Issue
Block a user