IO-Stream
view release on metacpan or search on metacpan
lib/IO/Stream.pm view on Meta::CPAN
# (Most probable reason: error in socket because there no more fd.)
socket $self->{fh}, AF_INET, SOCK_STREAM, PROTO_TCP
or croak "socket: $!";
if (!WIN32) {
fcntl $self->{fh}, F_SETFL, O_NONBLOCK or croak "fcntl: $!";
} else {
my $nb=1; ioctl $self->{fh}, FIONBIO, \$nb or croak "ioctl: $!";
}
}
# Keep this object alive, even if user doesn't keep it himself.
$self->{_id} = fileno $self->{fh};
if (!$self->{_id}) {
croak q{can't get file descriptor};
} elsif ($Active[ $self->{_id} ]) {
croak q{can't create second object for same fh};
} else {
$Active[ $self->{_id} ] = $self;
}
# Connect plugins into chain and setup {plugin}.
( run in 0.544 second using v1.01-cache-2.11-cpan-39bf76dae61 )