… | |
… | |
536 | |
536 | |
537 | # too many clueless people try to use udp and similar sockets |
537 | # too many clueless people try to use udp and similar sockets |
538 | # with AnyEvent::Handle, do them a favour. |
538 | # with AnyEvent::Handle, do them a favour. |
539 | my $type = getsockopt $self->{fh}, Socket::SOL_SOCKET (), Socket::SO_TYPE (); |
539 | my $type = getsockopt $self->{fh}, Socket::SOL_SOCKET (), Socket::SO_TYPE (); |
540 | Carp::croak "AnyEvent::Handle: only stream sockets supported, anything else will NOT work!" |
540 | Carp::croak "AnyEvent::Handle: only stream sockets supported, anything else will NOT work!" |
541 | if Socket::SOCK_STREAM != (unpack "I", $type) && defined $type; |
541 | if Socket::SOCK_STREAM () != (unpack "I", $type) && defined $type; |
542 | |
542 | |
543 | AnyEvent::Util::fh_nonblocking $self->{fh}, 1; |
543 | AnyEvent::Util::fh_nonblocking $self->{fh}, 1; |
544 | |
544 | |
545 | $self->{_activity} = |
545 | $self->{_activity} = |
546 | $self->{_ractivity} = |
546 | $self->{_ractivity} = |