poe component client ping 1.13
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 3813
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];
...;
}
<<lessSYNOPSIS
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];
...;
}
Download (0.013MB)
Added: 2007-04-17 License: Perl Artistic License Price:
920 downloads
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
<<lessSYNOPSIS
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
Download (0.020MB)
Added: 2007-05-03 License: Perl Artistic License Price:
905 downloads
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.
<<lessSYNOPSIS
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.
Download (0.006MB)
Added: 2007-01-02 License: Perl Artistic License Price:
1053 downloads
POE::Component::Client::AirTunes 0.01
POE::Component::Client::AirTunes is a Perl module with stream music to Airport Express. more>>
POE::Component::Client::AirTunes is a Perl module with stream music to Airport Express.
SYNOPSIS
use POE qw( Component::Client::AirTunes );
POE::Component::Client::AirTunes->new(
host => $ip,
alias => "airtunes",
events => {
connected => connected,
error => error,
done => done,
},
);
$kernel->post(airtunes => volume => 100);
$kernel->post(airtunes => play => "/path/to/foobar.m4a");
$kernel->post(airtunes => stop);
POE::Component::Client::AirTunes is a POE component to stream music files to your Airport Express. This module is a frontend for a command line Airport Express player raop_play, which is included in Airport Express Client, availabe at http://raop-play.sourceforge.net.
See t/01_airtunes.t for more example. This module is ALPHA software and its API might change in the future.
<<lessSYNOPSIS
use POE qw( Component::Client::AirTunes );
POE::Component::Client::AirTunes->new(
host => $ip,
alias => "airtunes",
events => {
connected => connected,
error => error,
done => done,
},
);
$kernel->post(airtunes => volume => 100);
$kernel->post(airtunes => play => "/path/to/foobar.m4a");
$kernel->post(airtunes => stop);
POE::Component::Client::AirTunes is a POE component to stream music files to your Airport Express. This module is a frontend for a command line Airport Express player raop_play, which is included in Airport Express Client, availabe at http://raop-play.sourceforge.net.
See t/01_airtunes.t for more example. This module is ALPHA software and its API might change in the future.
Download (0.003MB)
Added: 2007-01-05 License: GPL (GNU General Public License) Price:
1029 downloads
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();
<<lessSYNOPSIS
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();
Download (0.013MB)
Added: 2007-04-17 License: Perl Artistic License Price:
920 downloads
POE::Component::Client::TCPMulti 0.0521
POE::Component::Client::TCPMulti is a high performance client TCP library. more>>
POE::Component::Client::TCPMulti is a high performance client TCP library.
SYNOPSIS
# Short Usage
POE::Component::Client::TCPMulti->create
( InputEvent => sub {
printf "%s:%d: %s",
$_[CHEAP]->ADDR, $_[CHEAP]->PORT, $_[ARG0];
},
SuccessEvent => sub {
printf "%s:%d: Connection Recieved",
$_[CHEAP]->ADDR, $_[CHEAP]->PORT;
$_[KERNEL]->yield( send => "" );
},
inline_states => {
_start => sub {
$_[KERNEL]->yield( connect => "127.0.0.1", $_ )
for 1..1024;
},
},
InputTimeout => 15,
);
# Longer Usage
POE::Component::Client::TCPMulti->create
( InputEvent => sub {
$_[KERNEL]->yield(send => $_[CHEAP]->ID, "Some Stuff");
},
Initialize => sub {
$_[CHEAP]->input_filter
( "POE::Filter::Block", BlockSize => 4);
},
ErrorEvent => &ErrorHandle,
Disconnected => &ErrorHandle,
TimeoutEvent => &TimeoutHandle,
FailureEvent => &FailureHandle,
SuccessEvent => sub {
$_[CHEAP]->filter("POE::Filter::Line");
# Set timeout for this connection to 350 seconds.
$_[CHEAP]->timeout(350);
# This state is part of the component interface
$_[KERNEL]->yield(send => $_[CHEAP]->ID, "Some Data");
},
Domain => AF_INET, # Optional
Alias => "MySession", # Optional
InputTimeout => 360, # Seconds, Optional
ConnectTimeout => 30, # Seconds, Optional
Timeout => 30, # Seconds, Optional
Filter => "POE::Filter::Something", # Optional
inline_states => {
_start => sub {
$_[KERNEL]->yield(connect => q(127.0.0.1), 25);
# _start isnt needed if you use an alias.
},
},
args => $Session_Args, # Optional
object_states => $Object_States, # Optional
package_states => $Package_States, # Optional
);
# This should be done from within a state in the TCPMulti
# Session. Its purpose is to allow prepropigation of the
# connection heap as well as connection specific timeout
# Settings.
POE::Component::Client::TCPMulti->connect
( RemoteAddress => "127.0.0.1",
RemotePort => 25,
BindAddress => "127.0.0.1", # Optional
BindPort => 0, # Optional
ConnectTimeout => 50, # Connect only.
InputTimeout => 300, # Input only.
Heap => %Propigation );
POE::Component::Client::TCPMulti is a very lightweight, highly optimized component designed for large numbers of simultanious outgoing connections. The major advantage to this module over POE::Component::Client::TCP is that it runs in a single session, reguardless of the number of outgoing simultanious connections. I have found this in fact to use considerable less overhead than POE::Component::Client::TCP in high traffic. The disadvantage lies mearly in the API complexity over POE::Component::Client::TCP.
It is in fact due to this added API complexity that I decided to create a seperate module, rather than altering POE::Component::Client::TCP [ or coaxing Rocco to let me ]. POE::Component::Client::TCP is a great module and this is not designed to completely replace it. It is however designed as a solution for extremely high traffic situations when the overhead of an individual session for each outgoing connection is not appropriate for the added simplicity in the API. Especially considering that this API is not really *that* much more complex.
<<lessSYNOPSIS
# Short Usage
POE::Component::Client::TCPMulti->create
( InputEvent => sub {
printf "%s:%d: %s",
$_[CHEAP]->ADDR, $_[CHEAP]->PORT, $_[ARG0];
},
SuccessEvent => sub {
printf "%s:%d: Connection Recieved",
$_[CHEAP]->ADDR, $_[CHEAP]->PORT;
$_[KERNEL]->yield( send => "" );
},
inline_states => {
_start => sub {
$_[KERNEL]->yield( connect => "127.0.0.1", $_ )
for 1..1024;
},
},
InputTimeout => 15,
);
# Longer Usage
POE::Component::Client::TCPMulti->create
( InputEvent => sub {
$_[KERNEL]->yield(send => $_[CHEAP]->ID, "Some Stuff");
},
Initialize => sub {
$_[CHEAP]->input_filter
( "POE::Filter::Block", BlockSize => 4);
},
ErrorEvent => &ErrorHandle,
Disconnected => &ErrorHandle,
TimeoutEvent => &TimeoutHandle,
FailureEvent => &FailureHandle,
SuccessEvent => sub {
$_[CHEAP]->filter("POE::Filter::Line");
# Set timeout for this connection to 350 seconds.
$_[CHEAP]->timeout(350);
# This state is part of the component interface
$_[KERNEL]->yield(send => $_[CHEAP]->ID, "Some Data");
},
Domain => AF_INET, # Optional
Alias => "MySession", # Optional
InputTimeout => 360, # Seconds, Optional
ConnectTimeout => 30, # Seconds, Optional
Timeout => 30, # Seconds, Optional
Filter => "POE::Filter::Something", # Optional
inline_states => {
_start => sub {
$_[KERNEL]->yield(connect => q(127.0.0.1), 25);
# _start isnt needed if you use an alias.
},
},
args => $Session_Args, # Optional
object_states => $Object_States, # Optional
package_states => $Package_States, # Optional
);
# This should be done from within a state in the TCPMulti
# Session. Its purpose is to allow prepropigation of the
# connection heap as well as connection specific timeout
# Settings.
POE::Component::Client::TCPMulti->connect
( RemoteAddress => "127.0.0.1",
RemotePort => 25,
BindAddress => "127.0.0.1", # Optional
BindPort => 0, # Optional
ConnectTimeout => 50, # Connect only.
InputTimeout => 300, # Input only.
Heap => %Propigation );
POE::Component::Client::TCPMulti is a very lightweight, highly optimized component designed for large numbers of simultanious outgoing connections. The major advantage to this module over POE::Component::Client::TCP is that it runs in a single session, reguardless of the number of outgoing simultanious connections. I have found this in fact to use considerable less overhead than POE::Component::Client::TCP in high traffic. The disadvantage lies mearly in the API complexity over POE::Component::Client::TCP.
It is in fact due to this added API complexity that I decided to create a seperate module, rather than altering POE::Component::Client::TCP [ or coaxing Rocco to let me ]. POE::Component::Client::TCP is a great module and this is not designed to completely replace it. It is however designed as a solution for extremely high traffic situations when the overhead of an individual session for each outgoing connection is not appropriate for the added simplicity in the API. Especially considering that this API is not really *that* much more complex.
Download (0.023MB)
Added: 2007-04-17 License: Perl Artistic License Price:
920 downloads
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.
<<lessSYNOPSIS
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.
Download (0.042MB)
Added: 2006-11-15 License: Perl Artistic License Price:
1073 downloads
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.
<<lessSYNOPSIS
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.
Download (0.007MB)
Added: 2007-01-03 License: Perl Artistic License Price:
1032 downloads
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");
<<lessSYNOPSIS
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");
Download (0.003MB)
Added: 2006-11-07 License: Perl Artistic License Price:
1081 downloads
POE::Component::ControlPort 0.01
POE::Component::ControlPort is a Perl module with network control port for POE applications. more>>
POE::Component::ControlPort is a Perl module with network control port for POE applications.
SYNOPSIS
use POE;
use Getopt::Long;
use POE::Component::ControlPort;
use POE::Component::ControlPort::Command;
my @commands = (
{
help_text => My command,
usage => my_command [ arg1, arg2 ],
topic => custom,
name => my_command,
command => sub {
my %input = @_;
local @ARGV = @{ $input{args} };
GetOptions( ... );
},
}
);
POE::Component::ControlPort->create(
local_address => 127.0.0.1,
local_port => 31337,
# optional...
hostname => pie.pants.org,
appname => my perl app,
commands => @commands,
poe_debug => 1,
);
# other poe sessions or whatever ...
POE::Kernel->run();
When building network applications, it is often helpful to have a network accessible control and diagnostic interface. This module provides such an interface for POE applications. By default, it provides a fairly limited set of commands but is easily extended to provide whatever command set you require. In addition, if POE::Component::DebugShell version 1.018 or above is installed, a set of POE debug commands will be loaded.
<<lessSYNOPSIS
use POE;
use Getopt::Long;
use POE::Component::ControlPort;
use POE::Component::ControlPort::Command;
my @commands = (
{
help_text => My command,
usage => my_command [ arg1, arg2 ],
topic => custom,
name => my_command,
command => sub {
my %input = @_;
local @ARGV = @{ $input{args} };
GetOptions( ... );
},
}
);
POE::Component::ControlPort->create(
local_address => 127.0.0.1,
local_port => 31337,
# optional...
hostname => pie.pants.org,
appname => my perl app,
commands => @commands,
poe_debug => 1,
);
# other poe sessions or whatever ...
POE::Kernel->run();
When building network applications, it is often helpful to have a network accessible control and diagnostic interface. This module provides such an interface for POE applications. By default, it provides a fairly limited set of commands but is easily extended to provide whatever command set you require. In addition, if POE::Component::DebugShell version 1.018 or above is installed, a set of POE debug commands will be loaded.
Download (0.012MB)
Added: 2007-02-13 License: Perl Artistic License Price:
983 downloads
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.
<<lessSYNOPSIS
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.
Download (0.017MB)
Added: 2006-10-23 License: Perl Artistic License Price:
1096 downloads
POE::Component::Client::Traceroute 0.21
POE::Component::Client::Traceroute is a non-blocking traceroute client. more>>
POE::Component::Client::Traceroute is a non-blocking traceroute client.
SYNOPSIS
use POE qw(Component::Client::Traceroute);
POE::Component::Client::Traceroute->spawn(
Alias => tracer, # Defaults to tracer
FirstHop => 1, # Defaults to 1
MaxTTL => 16, # Defaults to 32 hops
Timeout => 0, # Defaults to never
QueryTimeout => 3, # Defaults to 3 seconds
Queries => 3, # Defaults to 3 queries per hop
BasePort => 33434, # Defaults to 33434
PacketLen => 128, # Defaults to 68
SourceAddress => 0.0.0.0, # Defaults to 0.0.0.0
PerHopPostback => 0, # Defaults to no PerHopPostback
Device => eth0, # Defaults to undef
UseICMP => 0, # Defaults to 0
Debug => 0, # Defaults to 0
DebugSocket => 0, # Defaults to 0
);
sub some_event_handler
{
$kernel->post(
"tracer", # Post request to tracer component
"traceroute", # Ask it to traceroute to an address
"trace_response", # Post answers to trace_response
$destination, # This is the host to traceroute to
[
Queries => 5, # Override the global queries parameter
MaxTTL => 30, # Override the global MaxTTL parameter
Callback => [ $args ], # Data to send back with postback event
]
);
}
# This is the sub which is called with the responses from the
# Traceroute component.
sub trace_response
{
my ($request,$response) = @_[ARG0, ARG1];
my ($destination, $options, $callback) = @$request;
my ($hops, $data, $error) = @$response;
if ($hops)
{
print "Traceroute results for $destinationn";
foreach my $hop (@$data)
{
my $hopnumber = $hop->{hop};
my $routerip = $hop->{routerip};
my @rtts = @{$hop->{results}};
print "$hopnumbert$routeript";
foreach (@rtts)
{
if ($_ eq "*") { print "* "; }
else { printf "%0.3fms ", $_*1000; }
}
print "n";
}
}
warn "Error occurred tracing to $destination: $errorn" if ($error);
}
or
sub another_event_handler
{
$kernel->post(
"tracer", # Post request to tracer component
"traceroute", # Ask it to traceroute to an address
"trace_response", # Post answers to trace_response
$destination, # This is the host to traceroute to
[
# The trace_row event will get called after each hop
PerHopPostback => trace_row,
]
);
}
sub trace_row
{
my ($request,$response) = @_[ARG0, ARG1];
my ($destination, $options, $callback) = @$request;
my ($currenthop, $data, $error) = @$response;
# $data only contains responses for the current TTL
# The structure is the same as for trace_response above
}
POE::Component::Client::Traceroute is a non-blocking Traceroute client. It lets several other sessions traceroute through it in parallel, and it lets them continue doing other things while they wait for responses.
<<lessSYNOPSIS
use POE qw(Component::Client::Traceroute);
POE::Component::Client::Traceroute->spawn(
Alias => tracer, # Defaults to tracer
FirstHop => 1, # Defaults to 1
MaxTTL => 16, # Defaults to 32 hops
Timeout => 0, # Defaults to never
QueryTimeout => 3, # Defaults to 3 seconds
Queries => 3, # Defaults to 3 queries per hop
BasePort => 33434, # Defaults to 33434
PacketLen => 128, # Defaults to 68
SourceAddress => 0.0.0.0, # Defaults to 0.0.0.0
PerHopPostback => 0, # Defaults to no PerHopPostback
Device => eth0, # Defaults to undef
UseICMP => 0, # Defaults to 0
Debug => 0, # Defaults to 0
DebugSocket => 0, # Defaults to 0
);
sub some_event_handler
{
$kernel->post(
"tracer", # Post request to tracer component
"traceroute", # Ask it to traceroute to an address
"trace_response", # Post answers to trace_response
$destination, # This is the host to traceroute to
[
Queries => 5, # Override the global queries parameter
MaxTTL => 30, # Override the global MaxTTL parameter
Callback => [ $args ], # Data to send back with postback event
]
);
}
# This is the sub which is called with the responses from the
# Traceroute component.
sub trace_response
{
my ($request,$response) = @_[ARG0, ARG1];
my ($destination, $options, $callback) = @$request;
my ($hops, $data, $error) = @$response;
if ($hops)
{
print "Traceroute results for $destinationn";
foreach my $hop (@$data)
{
my $hopnumber = $hop->{hop};
my $routerip = $hop->{routerip};
my @rtts = @{$hop->{results}};
print "$hopnumbert$routeript";
foreach (@rtts)
{
if ($_ eq "*") { print "* "; }
else { printf "%0.3fms ", $_*1000; }
}
print "n";
}
}
warn "Error occurred tracing to $destination: $errorn" if ($error);
}
or
sub another_event_handler
{
$kernel->post(
"tracer", # Post request to tracer component
"traceroute", # Ask it to traceroute to an address
"trace_response", # Post answers to trace_response
$destination, # This is the host to traceroute to
[
# The trace_row event will get called after each hop
PerHopPostback => trace_row,
]
);
}
sub trace_row
{
my ($request,$response) = @_[ARG0, ARG1];
my ($destination, $options, $callback) = @$request;
my ($currenthop, $data, $error) = @$response;
# $data only contains responses for the current TTL
# The structure is the same as for trace_response above
}
POE::Component::Client::Traceroute is a non-blocking Traceroute client. It lets several other sessions traceroute through it in parallel, and it lets them continue doing other things while they wait for responses.
Download (0.015MB)
Added: 2007-04-18 License: Perl Artistic License Price:
919 downloads
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.
<<lessSYNOPSIS
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.
Download (0.72MB)
Added: 2006-06-22 License: Perl Artistic License Price:
1219 downloads
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.
<<lessSYNOPSIS
# 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.
Download (0.23MB)
Added: 2006-06-15 License: Perl Artistic License Price:
1227 downloads
POE::Component::DebugShell 1.0411
POE::Component::DebugShell is a component to allow interactive peeking into a running POE application. more>>
POE::Component::DebugShell is a component to allow interactive peeking into a running POE application.
SYNOPSIS
use POE::Component::DebugShell;
POE::Component::DebugShell->spawn();
This component allows for interactive peeking into a running POE application.
spawn() creates a ReadLine enabled shell equipped with various debug commands. The following commands are available.
COMMANDS
show_sessions
debug> show_sessions
* 3 [ session 3 (POE::Component::DebugShell controller) ]
* 2 [ session 2 (PIE, PIE2) ]
Show a list of all sessions in the system. The output format is in the form of loggable session ids.
session_stats
debug> session_stats 2
Statistics for Session 2
Events coming from: 1
Events going to: 1
Display various statistics for a given session. Provide one session id as a parameter.
list_aliases
debug> list_aliases 2
Alias list for session 2
* PIE
* PIE2
List aliases for a given session id. Provide one session id as a parameter.
queue_dump
debug> queue_dump
Event Queue:
* ID: 738 - Index: 0
Priority: 1078459009.06715
Event: _sigchld_poll
* ID: 704 - Index: 1
Priority: 1078459012.42691
Event: ping
Dump the contents of the event queue. Add a -v parameter to get verbose output.
help
debug> help
The following commands are available:
...
Display help about available commands.
status
debug> status
This is POE::Component::DebugShell v1.14
running inside examples/foo.perl.
This console spawned at Thu Mar 4 22:51:51 2004.
There are 3 known sessions (including the kernel).
General shell status.
reload
debug> reload
Reloading...
Reload the shell
exit
debug> exit
Exiting...
Exit the shell
<<lessSYNOPSIS
use POE::Component::DebugShell;
POE::Component::DebugShell->spawn();
This component allows for interactive peeking into a running POE application.
spawn() creates a ReadLine enabled shell equipped with various debug commands. The following commands are available.
COMMANDS
show_sessions
debug> show_sessions
* 3 [ session 3 (POE::Component::DebugShell controller) ]
* 2 [ session 2 (PIE, PIE2) ]
Show a list of all sessions in the system. The output format is in the form of loggable session ids.
session_stats
debug> session_stats 2
Statistics for Session 2
Events coming from: 1
Events going to: 1
Display various statistics for a given session. Provide one session id as a parameter.
list_aliases
debug> list_aliases 2
Alias list for session 2
* PIE
* PIE2
List aliases for a given session id. Provide one session id as a parameter.
queue_dump
debug> queue_dump
Event Queue:
* ID: 738 - Index: 0
Priority: 1078459009.06715
Event: _sigchld_poll
* ID: 704 - Index: 1
Priority: 1078459012.42691
Event: ping
Dump the contents of the event queue. Add a -v parameter to get verbose output.
help
debug> help
The following commands are available:
...
Display help about available commands.
status
debug> status
This is POE::Component::DebugShell v1.14
running inside examples/foo.perl.
This console spawned at Thu Mar 4 22:51:51 2004.
There are 3 known sessions (including the kernel).
General shell status.
reload
debug> reload
Reloading...
Reload the shell
exit
debug> exit
Exiting...
Exit the shell
Download (0.007MB)
Added: 2007-02-13 License: Perl Artistic License Price:
983 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above poe component client ping 1.13 search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed