curl-users
Re: Telnet under win32
Date: Thu, 5 Jul 2001 21:25:18 +0200
> I tested the code and I see that it doesn't hog the CPU.
Good. I am positive that it takes a lot more than that to hog the CPU.
> >I like the WaitForMultipleObjects() approach better. It is of course a
> >bigger change, but it feels like it is more the Win32 way of doing it.
>
> I like the WaitForMultipleObjects() approach too as it is the correct way
> to handle such a loop under Win32. I avoided taking that path unless it
> was absolutely necessary as it is better to keep to the same code as far as
> possible for all platforms.
Very true. I was very reluctant too, but I couldn't find a better solution.
Yours is as good as any other, but it has a major drawback. It is assuming
that stdin comes from the keyboard. If you pipe into stdin it will not work.
I can't really figure out a way to poll a stdio stream in Win32 without
blocking. Can you?
/Linus
Received on 2001-07-05