1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-29 16:16:38 +00:00

[Net] Fix socket poll timeout on Windows.

Now correctly computes the timeout value in milliseconds.

(cherry picked from commit 46f7b0f74b)
This commit is contained in:
Fabio Alessandrelli
2021-04-26 07:23:39 +02:00
committed by Rémi Verschelde
parent dbf71c1b70
commit 890ec03431

View File

@@ -452,7 +452,7 @@ Error NetSocketPosix::poll(PollType p_type, int p_timeout) const {
FD_ZERO(&wr);
FD_ZERO(&ex);
FD_SET(_sock, &ex);
struct timeval timeout = { p_timeout, 0 };
struct timeval timeout = { p_timeout / 1000, (p_timeout % 1000) * 1000 };
// For blocking operation, pass NULL timeout pointer to select.
struct timeval *tp = NULL;
if (p_timeout >= 0) {