Skip to content

Commit

Permalink
nxcord: Log first udp read
Browse files Browse the repository at this point in the history
  • Loading branch information
Grarak committed Jan 11, 2020
1 parent c3506d2 commit 91115c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nxcord/src/discord_udp_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<sockaddr *>(&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 =
Expand Down

0 comments on commit 91115c9

Please sign in to comment.