Skip to content

Commit

Permalink
Merge pull request godotengine#48203 from Faless/net/4.x_socket_poll_…
Browse files Browse the repository at this point in the history
…timeout

[Net] Fix socket poll timeout on Windows.
  • Loading branch information
akien-mga authored Apr 27, 2021
2 parents eb74784 + 46f7b0f commit 1943d2b
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 1943d2b

Please sign in to comment.