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

[Bug] setsockopt SO_RCVTIMEO not working in Windows #409

Closed
pdematteis opened this issue May 14, 2024 · 1 comment · Fixed by #411
Closed

[Bug] setsockopt SO_RCVTIMEO not working in Windows #409

pdematteis opened this issue May 14, 2024 · 1 comment · Fixed by #411
Labels
bug Something isn't working

Comments

@pdematteis
Copy link

Describe the bug

In network.c, _z_open_udp_unicast() calls setsockopt() passing a z_time_t value, while in Windows it should be DWORD type.
Fixed by using:

#ifdef WIN32
        DWORD tv = tout;
#else
        z_time_t tv;
        tv.time = tout / (uint32_t)1000;
        tv.millitm = tout % (uint32_t)1000;
#endif

To reproduce

Start either a publisher or a subscriber with no parameters in Windows without zenohd running.
The application will stuck in Opening session... and the expected timeout is not honored.

System info

Windows 11

@pdematteis pdematteis added the bug Something isn't working label May 14, 2024
@jean-roland
Copy link
Contributor

Hello @pdematteis, thanks for notifying us, I'll investigate the issue and open a PR accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants