ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/t/handle/04_listen.t
(Generate patch)

Comparing AnyEvent/t/handle/04_listen.t (file contents):
Revision 1.11 by root, Wed May 21 14:37:55 2008 UTC vs.
Revision 1.12 by root, Fri May 23 17:47:06 2008 UTC

2 2
3use strict; 3use strict;
4 4
5use AnyEvent::Impl::Perl; 5use AnyEvent::Impl::Perl;
6use AnyEvent::Handle; 6use AnyEvent::Handle;
7use AnyEvent::Util; 7use AnyEvent::Socket;
8use AnyEvent; 8use AnyEvent;
9 9
10my $lbytes; 10my $lbytes;
11my $rbytes; 11my $rbytes;
12 12
15my $cv = AnyEvent->condvar; 15my $cv = AnyEvent->condvar;
16 16
17my $hdl; 17my $hdl;
18my $port; 18my $port;
19 19
20my $w = AnyEvent::Util::tcp_server undef, undef, 20my $w = tcp_server undef, undef,
21 sub { 21 sub {
22 my ($fh, $host, $port) = @_; 22 my ($fh, $host, $port) = @_;
23 23
24 $hdl = AnyEvent::Handle->new (fh => $fh, on_eof => sub { $cv->broadcast }); 24 $hdl = AnyEvent::Handle->new (fh => $fh, on_eof => sub { $cv->broadcast });
25 25
40 0 40 0
41 }; 41 };
42 42
43 43
44my $clhdl; 44my $clhdl;
45my $wc = AnyEvent::Util::tcp_connect localhost => $port, sub { 45my $wc = tcp_connect localhost => $port, sub {
46 my ($fh) = @_ 46 my ($fh) = @_
47 or die "connect: $!"; 47 or die "connect: $!";
48 48
49 $clhdl = AnyEvent::Handle->new (fh => $fh, on_eof => sub { $cv->broadcast }); 49 $clhdl = AnyEvent::Handle->new (fh => $fh, on_eof => sub { $cv->broadcast });
50 50

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines