Home   |   Contact Us   |   Site Map

 

 

 

  NB.pm Perldoc

 


NAME

Net::HTTP::NB - Non-blocking HTTP client


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; }


DESCRIPTION

Same interface as Net::HTTP 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.

If read_response_headers() did not see enough data to complete the headers an empty list is returned.

If read_entity_body() did not see new entity data in its read the value -1 is returned.


SEE ALSO

the Net::HTTP manpage


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.



 

Browse our Perldoc FAQs:

Perldoc Home

Perldoc Site Map


Previous Topics

mod_perl_hooks.pm Perldoc

mod_perl.pm Perldoc

ModuleConfig.pm Perldoc

Msg.pm Perldoc

MyConfig.pm Perldoc

mysql.pm Perldoc

Mysql.pm Perldoc

NamedNodeMap.pm Perldoc


Next Topics

NDBM_File.pm Perldoc

Negotiate.pm Perldoc

netent.pm Perldoc

Netrc.pm Perldoc

news.pm Perldoc

nntp.pm Perldoc

NNTP.pm Perldoc

NodeList.pm Perldoc


Website Spotlight

Domain Hosting with the Leader in Innovative and Comprehensive Web Hosting Solutions, Globalnet GNP.

Reliable Domain Hosting

 

Click here to increase your web traffic insantly!


 Copyright © 1999-2005 Globalnet Promotions, LLC.   |   TheServerRoom.org Home    |   Sitemap    |   RSS News Feeds