Skip to content

multi-single.c example #8200

Closed
Closed

Description

@melroy89

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

Activity

  1. jay commented on Dec 30, 2021

    @jay
    Member

    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.

  2. bagder commented on Dec 30, 2021

    @bagder
    Member

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

  3. added a commit that references this issue on Dec 30, 2021
    fdc5ff2
  4. melroy89 commented on Dec 30, 2021

    @melroy89
    Author

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

  5. melroy89 commented on Dec 30, 2021

    @melroy89
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions