diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-04-26 07:23:39 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-04-26 07:23:39 +0200 |
commit | 46f7b0f74bc8907fe988eb55169203a095babaf3 (patch) | |
tree | 7487adb4370c9408cde0c43bb6fe4f8e6d9ddec4 /drivers/unix | |
parent | 15a85fe9713668f8ba6143352fd27d419a96ba83 (diff) |
[Net] Fix socket poll timeout on Windows.
Now correctly computes the timeout value in milliseconds.
Diffstat (limited to 'drivers/unix')
-rw-r--r-- | drivers/unix/net_socket_posix.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/unix/net_socket_posix.cpp b/drivers/unix/net_socket_posix.cpp index 19753943c8..3baabdd2c7 100644 --- a/drivers/unix/net_socket_posix.cpp +++ b/drivers/unix/net_socket_posix.cpp @@ -446,7 +446,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 nullptr timeout pointer to select. struct timeval *tp = nullptr; if (p_timeout >= 0) { |