Net::HTTP::NB(3) User Contributed Perl Documentation Net::HTTP::NB(3)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
Net::HTTP
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.
perl v5.16.2 2012-02-15 Net::HTTP::NB(3)
Check Out this Related Man Page
Net::HTTP::NB(3pm) User Contributed Perl Documentation Net::HTTP::NB(3pm)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
Net::HTTP
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.
perl v5.14.2 2012-02-15 Net::HTTP::NB(3pm)
I am trying to read HTTP data from a socket. However, for the final set of data being read using read(), read blocks and the control doesnt come back for further processing. I tried using select, but it didn't work...
Any help would be greatly acknowledged.:) (2 Replies)
Hi,
I have a file which contains entries with different numbers, for example:
275|24hroff|sel,fill,dbw|
2758|24hroff|sel,fill,dbw|
2765|24hroff|sel,fill,dbw|
2920|24hroff|sel,fill,dbw|
I need to delete a line which contains certian number, for instance 275
I was trying to use 'sed' but... (3 Replies)
#!/usr/bin/perl
use strict;
use warnings;
use Net::Telnet ();
my $t = new Net::Telnet (Timeout => 10,
Prompt => '/.*(#|>|\))\s*$/');
my $remote_host='home';
$t->open(Host => $remote_host, Port =>23);
$t->login('root', 'pass');
the error that I get... (4 Replies)