From 91115c9c6976674e4bfc4e2d289c0aa5856cc873 Mon Sep 17 00:00:00 2001 From: Willi Ye Date: Sat, 11 Jan 2020 02:01:14 +0100 Subject: [PATCH] nxcord: Log first udp read --- nxcord/src/discord_udp_client.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nxcord/src/discord_udp_client.cpp b/nxcord/src/discord_udp_client.cpp index 9fc5a57..afa9c45 100644 --- a/nxcord/src/discord_udp_client.cpp +++ b/nxcord/src/discord_udp_client.cpp @@ -12,11 +12,16 @@ void receive_thread(DiscordUDPClient *udp_client) { size_t buf_size = 1920; uint8_t buf[buf_size]; socklen_t len; + bool first_read = true; while (udp_client->_receive_thread.isActive()) { int read = recvfrom(udp_client->_fd, buf, sizeof(buf), MSG_WAITALL, reinterpret_cast(&udp_client->_servaddr), &len); + if (first_read) { + Logger::write("UDP first read %d\n", read); + first_read = false; + } if (read > 0) { udp_client->_receiver_func_mutex.lock(); SleepyDiscord::GenericUDPClient::ReceiveHandler handler =