|
|
| Welcome to the Monastery | |
| PerlMonks |
Re: fcntl on Windowsby Adam (Vicar) |
| on Mar 21, 2001 at 00:49 UTC ( #65814=note: print w/ replies, xml ) | Need Help?? |
|
Yes, you can get fcntl on windows*. As for using it to do non blocking, I have to admit that I've never done it in Perl. But here is how I do it in C, and I suspect that the Perl way is almost identical: Update: We discover this later in this thread, but rather deep, so I'll reiterate it here. It turns out that the fcntl module is available on Win32, but not fcntl(2) the method. That is *nix specific. Camel2 states, "fcntl will produce a fatal error if used on a machine that doesn't implement fcntl(2)." My new recomendation is to use select to poll the socket, and when it has data, then read from it blocking. You can simulate non-blocking by using a small timeout on the select and only reading a few charaters (or even just 1) at a time. *Note that the standard distribution uses the local c compiler to create Fcntl.pm during install. It is possible then, that someone might not have Fcntl.pm, however ActiveState's distribution of Perl does include it.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||