--- AnyEvent/t/handle/03_http_req.t 2008/05/17 21:08:05 1.7 +++ AnyEvent/t/handle/03_http_req.t 2008/05/24 23:15:14 1.10 @@ -4,6 +4,7 @@ use AnyEvent::Impl::Perl; use AnyEvent; +use AnyEvent::Socket; use AnyEvent::Handle; unless ($ENV{PERL_ANYEVENT_NET_TESTS}) { @@ -18,11 +19,12 @@ my $rbytes; my $hdl; -my $wo = AnyEvent::Util::tcp_connect 'www.google.com', 80, sub { - my ($sock) = @_; +my $wo = tcp_connect 'www.google.com', 80, sub { + my ($fh) = @_; + $hdl = AnyEvent::Handle->new ( - fh => $sock, + fh => $fh, on_error => sub { warn "socket error: $!"; $cv->broadcast; @@ -40,7 +42,7 @@ } ); - $hdl->push_read_chunk (10, sub { + $hdl->push_read (chunk => 10, sub { my ($hdl, $data) = @_; unless (substr ($data, 0, 4) eq 'HTTP') {