=encoding euc-jp =head1 NAME =begin original Net::HTTP::NB - Non-blocking HTTP client =end original Net::HTTP::NB - 非ブロッキング HTTP クライアント =head1 SYNOPSIS use Net::HTTP::NB; my $s = Net::HTTP::NB->new(Host => "www.perl.com") || die $@; $s->write_request(GET => "/"); use IO::Select; my $sel = IO::Select->new($s); READ_HEADER: { die "Header timeout" unless $sel->can_read(10); my($code, $mess, %h) = $s->read_response_headers; redo READ_HEADER unless $code; } while (1) { die "Body timeout" unless $sel->can_read(10); my $buf; my $n = $s->read_entity_body($buf, 1024); last unless $n; print $buf; } =head1 DESCRIPTION =begin original Same interface as C but it will never try multiple reads when the read_response_headers() or read_entity_body() methods are invoked. This make it possible to multiplex multiple Net::HTTP::NB using select without risk blocking. =end original C と同じインターフェースですが、 read_response_headers() メソッドや read_entity_body() メソッドが 起動されたときに複数回読み込みを試みることはありません。 これにより、ブロッキングのリスクなしで、select を作った Net::HTTP::NB 多重化が可能になります。 =begin original If read_response_headers() did not see enough data to complete the headers an empty list is returned. =end original read_response_headers() はヘッダを完成させるのに十分なデータを 見つけられなかった場合には空リストが返されます。 =begin original If read_entity_body() did not see new entity data in its read the value -1 is returned. =end original read_entity_body() が読み込み中に新しいエンティティデータが 見つけられなかった場合、値 -1 が返されます。 =head1 SEE ALSO L =head1 COPYRIGHT Copyright 2001 Gisle Aas. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =begin meta Translated: SHIRAKATA Kentaro =end meta =cut