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

multi-single.c example #8200

Closed
melroy89 opened this issue Dec 30, 2021 · 4 comments
Closed

multi-single.c example #8200

melroy89 opened this issue Dec 30, 2021 · 4 comments

Comments

@melroy89
Copy link

melroy89 commented Dec 30, 2021

Hi,

I was questioning if this ifdefs regarding sleep portability is still required, at the top of the multi-single example: https://github.com/curl/curl/blob/master/docs/examples/multi-single.c#L37 ?

I think this should be part of the curl library itself, if it isn't already 😄 .

#ifdef _WIN32
#define WAITMS(x) Sleep(x)
#else
/* Portable sleep for platforms other than Windows. */
#define WAITMS(x)                               \ 
  struct timeval wait = { 0, (x) * 1000 };      \ 
  (void)select(0, NULL, NULL, NULL, &wait)
#endif

Regards,
Melroy van den Berg

@jay
Copy link
Member

jay commented Dec 30, 2021

I think this should be part of the curl library itself, if it isn't already

You mean add a curl_sleep()? I don't see much use of it.

@bagder
Copy link
Member

bagder commented Dec 30, 2021

WAITMS() is not even used in the example code ... 😄 I'll remove it.

bagder added a commit that referenced this issue Dec 30, 2021
As it isn't used.

Reported-by: Melroy van den Berg
Fixes #8200
@bagder bagder closed this as completed in e1b0410 Dec 30, 2021
@melroy89
Copy link
Author

Thank you Daniel. This is what I was thinking as well.

@melroy89
Copy link
Author

I think this multi_poll code has a sleep. To avoid busy waiting.

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

Successfully merging a pull request may close this issue.

3 participants