I have tried setting the socket to non-blocking using the $s->blocking(0) interface, but it does not appear to get set. The call to blocking always returns a 1.
#!/usr/bin/perl -w
use strict;
use strict;
use IO::Socket::UNIX;
my $sockname = 'Test_pipe';
my $sockname = 'Test_pipe';
unlink($sockname);
my $s = IO::Socket::UNIX->new(
Type => SOCK_STREAM,
Local => $sockname,
Listen => 10,
ReuseAddr => 1,
);
Type => SOCK_STREAM,
Local => $sockname,
Listen => 10,
ReuseAddr => 1,
);
my $val = $s->blocking(0);
print $val;
print $val;
my $val = $s->blocking();
print $val;
print $val;
Don't know if this makes any difference but my app is running on Red Hat Linux.
kwo
-----Original Message-----
From:!
$Bill
Luebkert [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 29, 2006 3:31 PM
To: [EMAIL PROTECTED]
Subject: Re: Is syswrite a blocking call?
[EMAIL PROTECTED] wrote:
> I need to know if syswrite is a blocking call. I am using it to write
> to a UNIX Socket. Somewhere in my application, my code is getting
> blocked. I have narrowed it down to the data write code.
>
> So I am wondering if syswrite blocks.
I think the default is blocking on most all socket calls. You can set the socket to non-blocking or do a select first to see if it will block.
_______________________________________________ ActivePerl mailing list [email protected] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
