From 7e4664ea250bde35f3ca43f20d80f69c9138df5b Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Wed, 20 Sep 2023 08:03:19 -0700 Subject: [PATCH] handle ping exceptions --- src/Client.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Client.cc b/src/Client.cc index e50f6456..134a684e 100644 --- a/src/Client.cc +++ b/src/Client.cc @@ -234,7 +234,11 @@ void Client::send_ping() { this->log.info("Sending ping command"); // The game doesn't use this timestamp; we only use it for debugging purposes be_uint64_t timestamp = now(); - this->channel.send(0x1D, 0x00, ×tamp, sizeof(be_uint64_t)); + try { + this->channel.send(0x1D, 0x00, ×tamp, sizeof(be_uint64_t)); + } catch (const exception& e) { + this->log.info("Failed to send ping: %s", e.what()); + } } void Client::dispatch_idle_timeout(evutil_socket_t, short, void* ctx) {