No subject
matthew_heusser at mcgraw-hill.com
matthew_heusser at mcgraw-hill.com
Tue Nov 28 07:45:59 CST 2000
To: ActiveState Perl Support
Fr: Matthew Heusser
Sir -
It appears to me that the Get/Set Flags macros for fcntl are not
supported in ActiveState Perl Build 613(*). Is this correct?
Here's my thought process: I have a program that maintains an array
of sockets(**) similar to recipe 17.13 in "The Perl CookBook" by Tworkinton.
It needs to iterate through the array, checking and handling each one,
but not waiting (blocking) to receive on any individual socket.
One of my functions is called nonblock, and is straight out of Tworkington:
#----Begin Code Snippit
# nonblock($socket) puts socket into nonblocking mode
sub nonblock {
my $socket = shift;
my $flags;
$flags = fcntl($socket, F_GETFL, 0)
or die "Can't get flags for socket: $!\n";
fcntl($socket, F_SETFL, $flags | O_NONBLOCK)
or die "Can't make socket nonblocking: $!\n";
}
#---End Code Snippit
When I run the program, I get the following response:
"Your vendor has not defined Fcntl macro F_GETFL, used at <file> line 285"
Commenting that line out, we find that F_SETFL isn't defined either.
Obviously, I'm trying to ensure that my sockets are non-blocking. Any ideas on
how to do this under the current build of ActiveState Perl? There should be
some
way of doing this.
thank you for your time,
Matthew Heusser
(*) - In a Windows 2000 Environment
(**) - I need the server to run in one process space, so fork()ing out isn't
an option.
More information about the grand-rapids-pm-list
mailing list