Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong timeout unit on windows #24

Open
panzergame opened this issue May 17, 2022 · 3 comments
Open

Wrong timeout unit on windows #24

panzergame opened this issue May 17, 2022 · 3 comments

Comments

@panzergame
Copy link

From microsoft documentation SO_RCVTIMEO and SO_SNDTIMEO are expressed in ms whereas in the code the timeout seems to be targetting 20s as for linux:

#ifdef WIN32
    const DWORD timeout = 20;
#else
    struct timeval timeout
    {
    };
    timeout.tv_sec = 20; // after 20 seconds connect() will timeout
    timeout.tv_usec = 0;
#endif
@ccanberry
Copy link

Exactly, also the communcation drops without any error making it difficult to find out where the problem was, should be 20000.

@zhutianyu888
Copy link

it's the right answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants