Merge pull request #48203 from Faless/net/4.x_socket_poll_timeout

[Net] Fix socket poll timeout on Windows.
This commit is contained in:
Rémi Verschelde 2021-04-27 13:45:52 +02:00 committed by GitHub
commit 1943d2bda6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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) {