Skip to content

Commit

Permalink
[Net] Fix socket poll timeout on Windows.
Browse files Browse the repository at this point in the history
Now correctly computes the timeout value in milliseconds.
  • Loading branch information
Faless committed Apr 26, 2021
1 parent 15a85fe commit 46f7b0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/unix/net_socket_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 46f7b0f

Please sign in to comment.