Main > Free Download Search >

Free poe component enc flac software for linux

poe component enc flac

Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 1216
POE::Component::Enc::Flac 1.01

POE::Component::Enc::Flac 1.01


POE::Component::Enc::Flac is a POE component to wrap FLAC encoder flac. more>>
POE::Component::Enc::Flac is a POE component to wrap FLAC encoder flac.

SYNOPSIS

use POE qw(Component::Enc::Flac);

$encoder1 = POE::Component::Enc::Flac->new();
$encoder1->enc(input => "/tmp/track03.wav");

$encoder2 = POE::Component::Enc::Flac->new(
parent => mainSession,
priority => 10,
compression => best,
status => flacStatus,
error => flacEerror,
warning => flacWarning,
done => flacDone,
);
$encoder2->enc(
input => "/tmp/track02.wav",
output => "/tmp/02.flac",
tracknumber => Track 2,
comment => [
title=Birdhouse in your Soul,
artist=They Might be Giants,
date=1990,
origin=CD,
]
);

POE::Kernel->run();

ABSTRACT

POE is a multitasking framework for Perl. FLAC stands for Free Lossless Audio Codec and flac is an encoder for this standard. This module wraps flac into the POE framework, simplifying its use in, for example, a CD music ripper and encoder application. It provides an object oriented interface.

<<less
Download (0.72MB)
Added: 2006-06-22 License: Perl Artistic License Price:
1219 downloads
POE::Component::Enc::Mp3 1.2

POE::Component::Enc::Mp3 1.2


POE::Component::Enc::Mp3 is a mp3 encoder wrapper. more>>
POE::Component::Enc::Mp3 is a mp3 encoder wrapper.

SYNOPSIS

use POE qw(Component::Enc::Mp3);

$mp3 = POE::Component::Enc::Mp3->new($bitrate => 160);

$mp3->enc("/tmp/tst.wav");

POE::Kernel->run();

This POE component encodes raw audio files into mp3 format. It is merely a wrapper for the notlame program.

METHODS

The module provides an object oriented interface as follows:

new

Used to initialise the system and create a module instance. The following parameters are available:

alias

Indicates the name of a session to which module callbacks are posted. Default: main.

bitrate

Should be self-evident. If left unspecified, defaults to 160.

enc < file-name > [del-orig]

Encodes the given file, naming it with a .mp3 extension. An optional true value for the second parameter indicates that the original file should be deleted.

e.g. $mp3->enc("/tmp/tst.wav");

<<less
Download (0.003MB)
Added: 2006-11-07 License: Perl Artistic License Price:
1081 downloads
PoJoe Component Libraries 1.1

PoJoe Component Libraries 1.1


PoJoe Component Libraries project is a set of Java POJO components, originally developed for OSMQ. more>>
PoJoe Component Libraries project is a set of Java POJO components, originally developed for OSMQ. Developers have found these components useful in building robust enterprise applications.
Of note are: a FIFO queue that utilizes memory until a size threshold is reached, paging overflow elements to a disk cache; a dynamic discovery mechanism for locating remote processes by name over an IP network, eliminating the need to identify a remote service with a specific host computer; and a set of peer-to-peer async message components that support n concurrent message publishers for each named subscriber.
Enhancements:
- Minor enhancements and bugfixes, and changing the license from GNU Lesser to Apache 2.0.
<<less
Download (0.87MB)
Added: 2007-06-12 License: The Apache License 2.0 Price:
521 downloads
POE::Component::Generic 0.0904

POE::Component::Generic 0.0904


POE::Component::Generic is a POE component that provides non-blocking access to a blocking object. more>>
POE::Component::Generic is a POE component that provides non-blocking access to a blocking object.

SYNOPSIS

use POE::Component::Generic;

my $telnet = POE::Component::Generic->spawn(

# required; main object is of this class
package => Net::Telnet,

# optional; Options passed to Net::Telnet->new()
object_options => [ ],

# optional; You can use $poco->session_id() instead
alias => telnet,
# optional; 1 to turn on debugging
debug => 1,
# optional; 1 to see the childs STDERR
verbose => 1,

# optional; Options passed to the internal session
options => { trace => 1 },

# optional; describe package signatures
packages => {
Net::Telnet => {
# Methods that require coderefs, and keep them after they
# return.

# The first arg is converted to a coderef
postbacks => { option_callback=>0 }
},
Other::Package => {
# only these methods are exposed
methods => [ qw( one two ) ],

# Methods that require coderefs, but dont keep them
# after they return
callbacks => [ qw( two ) ]
}
}
);

# Start your POE session, then...

$telnet->open( { event => result }, "rainmaker.wunderground.com");
# result state
sub result {
my ($kernel, $ref, $result) = @_[KERNEL, ARG0, ARG1];

if( $ref->{error} ) {
die join( , @{ $ref->{error} ) . "n";
}
print "connected: $resultn";
}


# Setup a postback
$telnet->option_callback( {}, "option_back" );

# option_back state
sub option_back {
my( $obj, $option, $is_remote,
$is_enabled, $was_enabled, $buf_position) = @_[ARG0..$#_];
# See L for a discussion of the above.

# NOTE: Callbacks and postbacks cant currently receive objects.
}

# Use a callback
# Pretend that $other was created as a proxy to an Other::Package object
$other->two( {}, sub { warn "I was called..." } );

my $code = $session->postback( "my_state" );
$other->two( {}, $code );

POE::Component::Generic is a POE component that provides a non-blocking wrapper around any object. It works by forking a child process with POE::Wheel::Run and creating the object in the child process. Method calls are then serialised and sent via STDIN to the child to be handled. Return values are posted back to your session via STDOUT. This means that all method arguments and return values must survive serialisation. If you need to pass coderefs, use "callbacks", "postbacks" or "factories".
Method calls are wrapped in eval in the child process so that errors may be propagated back to your session. See "OUTPUT".

Output to STDERR in the child, that is from your object, is shown only if debug or verbose is set.

STDOUT in the child, that is from your object, is redirected to STDERR and will be shown in the same circomstances.

<<less
Download (0.030MB)
Added: 2006-06-12 License: Perl Artistic License Price:
1229 downloads
POE::Component::IRC 4.93

POE::Component::IRC 4.93


POE::Component::IRC is a fully event-driven IRC client module. more>>
POE::Component::IRC is a fully event-driven IRC client module.

SYNOPSIS

# A simple Rot13 encryption bot

use strict;
use warnings;
use POE qw(Component::IRC);

my $nickname = Flibble . $$;
my $ircname = Flibble the Sailor Bot;
my $ircserver = irc.blahblahblah.irc;
my $port = 6667;

my @channels = ( #Blah, #Foo, #Bar );

# We create a new PoCo-IRC object and component.
my $irc = POE::Component::IRC->spawn(
nick => $nickname,
server => $ircserver,
port => $port,
ircname => $ircname,
) or die "Oh noooo! $!";

POE::Session->create(
package_states => [
main => [ qw(_default _start irc_001 irc_public) ],
],
heap => { irc => $irc },
);

$poe_kernel->run();
exit 0;

sub _start {
my ($kernel,$heap) = @_[KERNEL,HEAP];

# We get the session ID of the component from the object
# and register and connect to the specified server.
my $irc_session = $heap->{irc}->session_id();
$kernel->post( $irc_session => register => all );
$kernel->post( $irc_session => connect => { } );
undef;
}

sub irc_001 {
my ($kernel,$sender) = @_[KERNEL,SENDER];

# Get the components object at any time by accessing the heap of
# the SENDER
my $poco_object = $sender->get_heap();
print "Connected to ", $poco_object->server_name(), "n";

# In any irc_* events SENDER will be the PoCo-IRC session
$kernel->post( $sender => join => $_ ) for @channels;
undef;
}

sub irc_public {
my ($kernel,$sender,$who,$where,$what) = @_[KERNEL,SENDER,ARG0,ARG1,ARG2];
my $nick = ( split /!/, $who )[0];
my $channel = $where->[0];

if ( my ($rot13) = $what =~ /^rot13 (.+)/ ) {
$rot13 =~ tr[a-zA-Z][n-za-mN-ZA-M];
$kernel->post( $sender => privmsg => $channel => "$nick: $rot13" );
}
undef;
}

# We registered for all events, this will produce some debug info.
sub _default {
my ($event, $args) = @_[ARG0 .. $#_];
my @output = ( "$event: " );

foreach my $arg ( @$args ) {
if ( ref($arg) eq ARRAY ) {
push( @output, "[" . join(" ,", @$arg ) . "]" );
} else {
push ( @output, "$arg" );
}
}
print STDOUT join , @output, "n";
return 0;
}

POE::Component::IRC is a POE component (whod have guessed?) which acts as an easily controllable IRC client for your other POE components and sessions. You create an IRC component and tell it what events your session cares about and where to connect to, and it sends back interesting IRC events when they happen. You make the client do things by sending it events. Thats all there is to it. Cool, no?

[Note that using this module requires some familiarity with the details of the IRC protocol. Id advise you to read up on the gory details of RFC 1459 before you get started. Keep the list of server numeric codes handy while you program. Needless to say, youll also need a good working knowledge of POE, or this document will be of very little use to you.]
The POE::Component::IRC distribution has a docs/ folder with a collection of salient documentation including the pertinent RFCs.

POE::Component::IRC consists of a POE::Session that manages the IRC connection and dispatches irc_ prefixed events to interested sessions and an object that can be used to access additional information using methods.

Sessions register their interest in receiving irc_ events by sending register to the component. One would usually do this in your _start handler. Your session will continue to receive events until you unregister. The component will continue to stay around until you tell it not to with shutdown.

The SYNOPSIS demonstrates a fairly basic bot.

<<less
Download (0.23MB)
Added: 2006-06-15 License: Perl Artistic License Price:
1227 downloads
POE::Component::Basement 0.01

POE::Component::Basement 0.01


POE::Component::Basement provides Class::Std and base POE component functionality. more>>
POE::Component::Basement provides Class::Std and base POE component functionality.

SYNOPSIS

package POE::MyComponent;

# use as base
use base qw/ POE::Component::Basement /;

# where the initializations happen (see Class::Std)
sub BUILD { ... }

# see also Class::Std and Class::Data::Inheritable also
# for accessor creation etc.

# define states
sub state_one : State( :inline< _start > ) { ... }
sub state_two : State( :object< foo > ) { ... }
sub state_three : State( :package< bar > ) { ... }

# combined
sub state_multi : State( :inline< foobar > :package< snafoo > ) { ... }
...

# chained events
sub first : State( :object< foo > :chained< bar > ) { ... }
sub second : State( :object< bar > ) { ... }
...

# calling in a row
sub first : State( :object< foo > :next< bar > ) { ... }
sub second : State( :object< bar > ) { ... }
...

# usage
my $comp = POE::MyComponent->new ({

# single alias or array reference for multiple
aliases => [qw/ mycomp shub_niggurath /],

... # your specific init_args.
});

Provides Class::Std and base POE component functionality. This module is still kinda experimental.

<<less
Download (0.017MB)
Added: 2006-10-23 License: Perl Artistic License Price:
1096 downloads
POE::Component::OSCAR 0.05

POE::Component::OSCAR 0.05


POE::Component::OSCAR is a POE component for the Net::OSCAR module. more>>
POE::Component::OSCAR is a POE component for the Net::OSCAR module.

SYNOPSIS

use POE qw(Component::OSCAR);

[ ... POE set up ... ]

sub _start { # start an OSCAR session $oscar = POE::Component::OSCAR->new();
# start an OSCAR session with automatic throttling of new connections
# to prevent being banned by the server
$oscar = POE::Component::OSCAR->new( throttle => 4 );

# set up the "im_in" callback to call your state, "im_in_state"
$oscar->set_callback( im_in => im_in_state);

# its good to detect errors if you dont want to get banned
$oscar->set_callback( error => error_state );
$oscar->set_callback( admin_error => admin_erro_stater );
$oscar->set_callback( rate_alert => rate_alert_state );

# sign on
$oscar->signon( screenname => $MY_SCREENNAME, password => $MY_PASSWORD );
}
sub im_in_state { my ($nothing, $args) = @_[ARG0..$#_]; my ($object, $who, $what, $away) = @$args;
print "Got $what from $whon";
}

<<less
Download (0.006MB)
Added: 2007-04-18 License: Perl Artistic License Price:
919 downloads
POE::Component::Client::Rcon 0.23

POE::Component::Client::Rcon 0.23


POE::Component::Client::Rcon is an implementation of the Rcon remote console protocol. more>>
POE::Component::Client::Rcon is an implementation of the Rcon remote console protocol.

SYNOPSIS

use POE qw(Component::Client::Rcon);

my $rcon = new POE::Component::Client::Rcon(Alias => rcon,
Timeout => 15,
Retry => 2,
Bytes => 8192,
);

$kernel->post(rcon, rcon, hl, 127.0.0.1, 27015,
rcon_password, status,
postback_event, identifier);

$kernel->post(rcon, players, hl, 127.0.0.1, 27015,
rcon_password,
player_postback_event, identifier);

sub postback_handler {
my ($type, $ip, $port, $command, $identifier, $response) = @_;
print "Rcon command of $command_executed to a $type server";
print " at $ip:$port";
print " had a identifier of $identifier" if defined $identifier;
print " returned from the server with:n$responsen";
}

sub player_postback_handler {
my ($type, $ip, $port, $identifier, $players) = @_;
use Data::Dumper;
print "Current players at a $type server at $ip:$port";
print " with identifier of $identifier" if defined $identifier;
print ":n", Dumper($players);
}

POE::Component::Client::Rcon is an implementation of the Rcon protocol -- the protocol commonly used to remotely administer Half-Life, Quake, and RTCW (Return to Castle Wolfenstein) servers. It is capable of handling multiple Rcon requests simultaneously, even multiple requests to the same IP/Port simultaneously.

<<less
Download (0.006MB)
Added: 2007-01-02 License: Perl Artistic License Price:
1053 downloads
Simple components for Ada 2.5

Simple components for Ada 2.5


Simple components for Ada is a simple component library for Ada. more>>
Simple components for Ada library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
As a special exception, if other files instantiate generics from this unit, or you link this unit with other files to produce an executable, this unit does not by itself cause the resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why the executable file might be covered by the GNU Public License.
Enhancements:
- Functions Is_In were added for doubly-linked webs and lists. GPS project files were added for GNAT users.
<<less
Download (0.37MB)
Added: 2007-05-20 License: GMGPL (GNAT Modified GPL) Price:
898 downloads
POE::Component::Client::FTP 0.07

POE::Component::Client::FTP 0.07


POE::Component::Client::FTP is a Perl module that implements an FTP client POE Component. more>>
POE::Component::Client::FTP is a Perl module that implements an FTP client POE Component.

SYNOPSIS

use POE::Component::Client::FTP;

POE::Component::Client::FTP->spawn ( Alias => ftp, Username => test, Password => test, RemoteAddr => localhost, Events => [ qw( authenticated put_connected put_error put_closed get_connected get_data get_done size ) ] );

# we are authenticated sub authenticated { $poe_kernel->post(ftp, command, args); }
# data connection is ready for data sub put_connected { my ($status, $line, $param) = @_[ARG0..ARG3];
open FILE, "/etc/passwd" or die $!;
$poe_kernel->post(ftp, put_data, $_) while ( );
close FILE;
$poe_kernel->post(ftp, put_close);
}
# something bad happened sub put_error { my ($error, $param) = @_[ARG0,ARG1];
warn "ERROR: $error occured while trying to STOR $param";
}
# data connection closed sub put_closed { my ($param) = @_[ARG0]; }
# file on the way... sub get_connected { my ($filename) = @_[ARG0]; }
# getting data from the file... sub get_data { my ($data, $filename) = @_[ARG0,ARG1];
}
# and its done sub get_done { my ($filename) = @_[ARG0]; }
# response to a size command sub size { my ($code, $size, $filename) = @_[ARG0,ARG1,ARG2];
print "$filename was $size";
}
$poe_kernel->run();

<<less
Download (0.013MB)
Added: 2007-04-17 License: Perl Artistic License Price:
920 downloads
POE::Component::Client::Halo 0.2

POE::Component::Client::Halo 0.2


POE::Component::Client::Halo is an implementation of the Halo query protocol. more>>
POE::Component::Client::Halo is an implementation of the Halo query protocol.

SYNOPSIS

use Data::Dumper; # for the sample below
use POE qw(Component::Client::Halo);

my $halo = new POE::Component::Client::Halo(
Alias => halo,
Timeout => 15,
Retry => 2,
);

$kernel->post(halo, info, 127.0.0.1, 2302, pbhandler, ident);

$kernel->post(halo, detail, 127.0.0.1, 2302, pbhandler, ident);

sub postback_handler {
my ($ip, $port, $command, $identifier, $response) = @_;
print "Halo query $command_executed on ";
print " at $ip:$port";
print " had a identifier of $identifier" if defined $identifier;
print " returned from the server with:";
print Dumper($response), "nn";
}

POE::Component::Client::Halo is an implementation of the Halo query protocol. It was reverse engineered with a sniffer and two cups of coffee. This is a preliminary release, based version 1.00.01.0580 of the dedicated server (the first public release). It is capable of handling multiple requests of different types in parallel.

<<less
Download (0.007MB)
Added: 2007-01-03 License: Perl Artistic License Price:
1032 downloads
POE::Component::Server::IRC 1.05

POE::Component::Server::IRC 1.05


POE::Component::Server::IRC is a fully event-driven networkable IRC server daemon module. more>>
POE::Component::Server::IRC is a fully event-driven networkable IRC server daemon module.

SYNOPSIS

# A fairly simple example:
use strict;
use warnings;
use POE qw(Component::Server::IRC);

my %config = (
servername => simple.poco.server.irc,
nicklen => 15,
network => SimpleNET
);

my $pocosi = POE::Component::Server::IRC->spawn( config => %config );

POE::Session->create(
package_states => [
main => [qw(_start _default)],
],
heap => { ircd => $pocosi },
);

$poe_kernel->run();
exit 0;

sub _start {
my ($kernel,$heap) = @_[KERNEL,HEAP];
$heap->{ircd}->yield( register );
# Anyone connecting from the loopback gets spoofed hostname
$heap->{ircd}->add_auth( mask => *@localhost, spoof => m33p.com, no_tilde => 1 );
# We have to add an auth as we have specified one above.
$heap->{ircd}->add_auth( mask => *@* );
# Start a listener on the standard IRC port.
$heap->{ircd}->add_listener( port => 6667 );
# Add an operator who can connect from localhost
$heap->{ircd}->add_operator( { username => moo, password => fishdont } );
undef;
}

sub _default {
my ( $event, $args ) = @_[ ARG0 .. $#_ ];
print STDOUT "$event: ";
foreach (@$args) {
SWITCH: {
if ( ref($_) eq ARRAY ) {
print STDOUT "[", join ( ", ", @$_ ), "] ";
last SWITCH;
}
if ( ref($_) eq HASH ) {
print STDOUT "{", join ( ", ", %$_ ), "} ";
last SWITCH;
}
print STDOUT "$_ ";
}
}
print STDOUT "n";
return 0; # Dont handle signals.
}

POE::Component::Server::IRC is a POE component which implements an IRC server ( also referred to as an IRC daemon or IRCd ). It should be compliant with the pertient IRC RFCs and is based on reverse engineering Hybrid IRCd behaviour with regards to interactions with IRC clients and other IRC servers.

Yes, thats right. POE::Component::Server::IRC is capable of linking to form IRC networks. It supports the TS5 server to server protocol and has been tested with linking to Hybrid-7 based networks. It should in theory work with any TS5-based IRC network.

POE::Component::Server::IRC also has a services API, which enables one to extend the IRCd to create IRC Services. This is fully event-driven ( of course =] ). There is also a Plugin system, similar to that sported by POE::Component::IRC.

<<less
Download (0.084MB)
Added: 2006-11-28 License: Perl Artistic License Price:
1062 downloads
POE::Component::Client::SMTP 0.14

POE::Component::Client::SMTP 0.14


POE::Component::Client::SMTP is a Perl module for asynchronous mail sending with POE. more>>
POE::Component::Client::SMTP is a Perl module for asynchronous mail sending with POE. Thus your program isnt blocking while busy talking with an (E)SMTP server.

SYNOPSIS

Warning! The following examples are not complete programs, and arent designed to be run as full blown applications. Their purpose is to quickly introduce you to the module.

For complete examples, check the eg directory that can be found in the distributions kit.

A simple example:

# load PoCoClient::SMTP
use POE::Component::Client::SMTP;
# spawn a session
POE::Component::Client::SMTP->send(
From => foo@baz.com,
To => john@doe.net,
Server => relay.mailer.net,
SMTP_Success => callback_event_for_success,
SMTP_Failure => callback_event_for_failure,
);
# and you are all set ;-)
A more complex example:
# load PoCoClient::SMTP
use POE::Component::Client::SMTP;
# spawn a session
POE::Component::Client::SMTP->send(
# Email related parameters
From => foo@baz.com,
To => [
john@doe.net,
andy@zzz.org,
peter@z.net,
george@g.com,
],
Body => $email_body, # heres where your message is stored
Server => relay.mailer.net,
Timeout => 100, # 100 seconds before timeouting
# POE related parameters
Alias => pococlsmtpX,
SMTP_Success => callback_event_for_success,
SMTP_Failure => callback_event_for_failure,
);
# and you are all set

<<less
Download (0.020MB)
Added: 2007-05-03 License: Perl Artistic License Price:
905 downloads
POE::Component::Client::Ping 1.13

POE::Component::Client::Ping 1.13


POE::Component::Client::Ping is a non-blocking ICMP ping client. more>>
POE::Component::Client::Ping is a non-blocking ICMP ping client.

SYNOPSIS

use POE qw(Component::Client::Ping);

POE::Component::Client::Ping->spawn(
Alias => "pingthing", # defaults to "pinger"
Timeout => 10, # defaults to 1 second
Retry => 3, # defaults to 1 attempt
OneReply => 1, # defaults to disabled
Parallelism => 20, # defaults to undef
BufferSize => 65536, # defaults to undef
AlwaysDecodeAddress => 1, # defaults to 0
);

sub some_event_handler {
$kernel->post(
"pingthing", # Post the request to the "pingthing" component.
"ping", # Ask it to "ping" an address.
"pong", # Have it post an answer as a "pong" event.
$address, # This is the address we want to ping.
$timeout, # Optional timeout. It overrides the default.
$retry, # Optional retries. It overrides the default.
);
}

# This is the sub which is called when the session receives a "pong"
# event. It handles responses from the Ping component.
sub got_pong {
my ($request, $response) = @_[ARG0, ARG1];

my ($req_address, $req_timeout, $req_time) = @$request;
my ($resp_address, $roundtrip_time, $resp_time, $resp_ttl) = @$response;

# The response address is defined if this is a response.
if (defined $resp_address) {
printf(
"ping to %-15.15s at %10d. pong from %-15.15s in %6.3f sn",
$req_address, $req_time,
$resp_address, $roundtrip_time,
);
return;
}

# Otherwise the timeout period has ended.
printf(
"ping to %-15.15s is done.n", $req_address,
);
}

or

use POE::Component::Client::Ping ":const";

# Post an array ref as the callback to get data back to you
$kernel->post("pinger", "ping", [ "pong", $user_data ]);

# use the REQ_USER_ARGS constant to get to your data
sub got_pong {
my ($request, $response) = @_[ARG0, ARG1];
my $user_data = $request->[REQ_USER_ARGS];
...;
}

<<less
Download (0.013MB)
Added: 2007-04-17 License: Perl Artistic License Price:
920 downloads
POE::Component::Client::HTTP 0.79

POE::Component::Client::HTTP 0.79


POE::Component::Client::HTTP is a HTTP user-agent component. more>>
POE::Component::Client::HTTP is a HTTP user-agent component.

SYNOPSIS

use POE qw(Component::Client::HTTP);

POE::Component::Client::HTTP->spawn(
Agent => SpiffCrawler/0.90, # defaults to something long
Alias => ua, # defaults to weeble
From => spiffster@perl.org, # defaults to undef (no header)
Protocol => HTTP/0.9, # defaults to HTTP/1.1
Timeout => 60, # defaults to 180 seconds
MaxSize => 16384, # defaults to entire response
Streaming => 4096, # defaults to 0 (off)
FollowRedirects => 2 # defaults to 0 (off)
Proxy => "http://localhost:80", # defaults to HTTP_PROXY env. variable
NoProxy => [ "localhost", "127.0.0.1" ], # defs to NO_PROXY env. variable
);

$kernel->post(
ua, # posts to the ua alias
request, # posts to uas request state
response, # which of our states will receive the response
$request, # an HTTP::Request object
);

# This is the sub which is called when the session receives a
# response event.
sub response_handler {
my ($request_packet, $response_packet) = @_[ARG0, ARG1];

# HTTP::Request
my $request_object = $request_packet->[0];

# HTTP::Response
my $response_object = $response_packet->[0];

my $stream_chunk;
if (! defined($response_object->content)) {
$stream_chunk = $response_packet->[1];
}

print(
"*" x 78, "n",
"*** my request:n",
"-" x 78, "n",
$request_object->as_string(),
"*" x 78, "n",
"*** their response:n",
"-" x 78, "n",
$response_object->as_string(),
);

if (defined $stream_chunk) {
print "-" x 40, "n", $stream_chunk, "n";
}

print "*" x 78, "n";
}

POE::Component::Client::HTTP is an HTTP user-agent for POE. It lets other sessions run while HTTP transactions are being processed, and it lets several HTTP transactions be processed in parallel.

If POE::Component::Client::DNS is also installed, Client::HTTP will use it to resolve hosts without blocking. Otherwise it will use gethostbyname(), which may have performance problems.

HTTP client components are not proper objects. Instead of being created, as most objects are, they are "spawned" as separate sessions. To avoid confusion (and hopefully not cause other confusion), they must be spawned with a spawn method, not created anew with a new one.

<<less
Download (0.042MB)
Added: 2006-11-15 License: Perl Artistic License Price:
1073 downloads
Secleted [ 0 ] software to compare
  • Page: 1 of 5
  • 1
  • 2
  • 3
  • 4
  • 5