… | |
… | |
2 | |
2 | |
3 | # actually tests a few other read/write types as well |
3 | # actually tests a few other read/write types as well |
4 | |
4 | |
5 | use strict; |
5 | use strict; |
6 | |
6 | |
7 | use AnyEvent::Impl::Perl; |
7 | use AnyEvent; |
|
|
8 | BEGIN { require AnyEvent::Impl::Perl unless $ENV{PERL_ANYEVENT_MODEL} } |
8 | use AnyEvent::Handle; |
9 | use AnyEvent::Handle; |
|
|
10 | use AnyEvent::Util; |
9 | use Test::More tests => 8; |
11 | use Test::More tests => 8; |
10 | use Socket; |
12 | use Socket; |
11 | use Errno; |
13 | use Errno; |
12 | |
14 | |
13 | { |
15 | { |
14 | my $cv = AnyEvent->condvar; |
16 | my $cv = AnyEvent->condvar; |
15 | |
17 | |
16 | socketpair my $rd, my $wr, AF_UNIX, SOCK_STREAM, PF_UNSPEC; |
18 | my ($rd, $wr) = portable_socketpair; |
17 | |
19 | |
18 | my $rd_ae = AnyEvent::Handle->new ( |
20 | my $rd_ae = AnyEvent::Handle->new ( |
19 | fh => $rd, |
21 | fh => $rd, |
20 | on_error => sub { |
22 | on_error => sub { |
21 | ok ($! == &Errno::EPIPE); |
23 | ok ($! == &Errno::EPIPE); |
… | |
… | |
45 | } |
47 | } |
46 | |
48 | |
47 | { |
49 | { |
48 | my $cv = AnyEvent->condvar; |
50 | my $cv = AnyEvent->condvar; |
49 | |
51 | |
50 | socketpair my $rd, my $wr, AF_UNIX, SOCK_STREAM, PF_UNSPEC; |
52 | my ($rd, $wr) = portable_socketpair; |
51 | |
53 | |
52 | my $concat; |
54 | my $concat; |
53 | |
55 | |
54 | my $rd_ae = |
56 | my $rd_ae = |
55 | AnyEvent::Handle->new ( |
57 | AnyEvent::Handle->new ( |