Skip to content

Commit

Permalink
voipchat: print an error message when failing to send datagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
madebr committed Oct 23, 2024
1 parent 1a65ee9 commit d755aca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/voipchat.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ static void SendClientAudioToServer(void)
((Uint64 *) scratch_area)[0] = SDL_Swap64LE(0); /* just being nice and leaving space in the buffer for the server to replace. */
((Uint64 *) scratch_area)[1] = SDL_Swap64LE(++next_idnum);
SDL_Log("CLIENT: Sending %d new bytes to server at %s:%d...", br + extra, SDLNet_GetAddressString(server_addr), (int) server_port);
SDLNet_SendDatagram(sock, server_addr, server_port, scratch_area, br + extra);
if (SDLNet_SendDatagram(sock, server_addr, server_port, scratch_area, br + extra) < 0) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDLNet_SendDatagram failed: %s", SDL_GetError());
}
}
}

Expand Down

0 comments on commit d755aca

Please sign in to comment.