[Net] Fix socket poll timeout on Windows.
Now correctly computes the timeout value in milliseconds.
This commit is contained in:
parent
15a85fe971
commit
46f7b0f74b
1 changed files with 1 additions and 1 deletions
|
@ -446,7 +446,7 @@ Error NetSocketPosix::poll(PollType p_type, int p_timeout) const {
|
||||||
FD_ZERO(&wr);
|
FD_ZERO(&wr);
|
||||||
FD_ZERO(&ex);
|
FD_ZERO(&ex);
|
||||||
FD_SET(_sock, &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.
|
// For blocking operation, pass nullptr timeout pointer to select.
|
||||||
struct timeval *tp = nullptr;
|
struct timeval *tp = nullptr;
|
||||||
if (p_timeout >= 0) {
|
if (p_timeout >= 0) {
|
||||||
|
|
Loading…
Reference in a new issue