Linux iad1-shared-b7-18 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
Apache
: 67.205.6.31 | : 216.73.216.47
Cant Read [ /etc/named.conf ]
8.2.29
fernandoquevedo
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
libpoe-perl /
examples /
[ HOME SHELL ]
Name
Size
Permission
Action
README.samples
165
B
-rw-r--r--
create.perl
7.81
KB
-rw-r--r--
fakelogin.perl
5.22
KB
-rw-r--r--
forkbomb.perl
5.95
KB
-rw-r--r--
names.perl
10.81
KB
-rw-r--r--
objmaps.perl
4.5
KB
-rw-r--r--
objsessions.perl
4.29
KB
-rw-r--r--
packagesessions.perl
3.97
KB
-rw-r--r--
queue.perl
4.11
KB
-rw-r--r--
selects.perl
13.31
KB
-rw-r--r--
sessions.perl
7.56
KB
-rw-r--r--
signals.perl
4.33
KB
-rw-r--r--
tcp_watermarks.perl
4.88
KB
-rw-r--r--
thrash.perl
16.92
KB
-rw-r--r--
watermarks.perl
5.97
KB
-rw-r--r--
wheels2.perl
4.81
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : objmaps.perl
#!/usr/bin/perl -w # This is another simple functionality test. It tests sessions that # are composed of objects (also called "object sessions"). The # difference between this and objsessions.perl is that the object # method names do not match their state names. use strict; use lib '../lib'; use POE; #============================================================================== # Counter is an object that roughly approximates "child" sessions from # the sessions.perl test. It counts for a little while, then stops. package Counter; use strict; use POE::Session; #------------------------------------------------------------------------------ # This is a normal Perl object method. It creates a new Counter # instance and returns a reference to it. It's also possible for the # object to wrap itself in a Session within the constructor. # Self-wrapping objects are explored in other examples. sub new { my ($type, $name) = @_; print "Session ${name}'s object created.\n"; bless { 'name' => $name }, $type; } #------------------------------------------------------------------------------ # This is a normal Perl object method. It destroys a Counter object, # doing any late cleanup on the object. This is different than the # _stop event handler, which handles late cleanup on the object's # Session. sub DESTROY { my $self = shift; print "Session $self->{name}'s object destroyed.\n"; } #------------------------------------------------------------------------------ # This method is an event handler. It sets the session in motion # after POE sends the standard _start event. sub poe_start { my ($object, $session, $heap, $kernel) = @_[OBJECT, SESSION, HEAP, KERNEL]; # register a signal handler $kernel->sig('INT', 'sigint'); # initialize the counter $heap->{'counter'} = 0; # hello, world! print "Session $object->{'name'} started.\n"; $kernel->post($session, 'increment'); } #------------------------------------------------------------------------------ # This method is an event handler, too. It cleans up after receiving # POE's standard _stop event. sub poe_stop { my ($object, $kernel, $heap) = @_[OBJECT, KERNEL, HEAP]; print "Session $object->{'name'} stopped after $heap->{'counter'} loops.\n"; } #------------------------------------------------------------------------------ # This method is an event handler. It will be registered as a SIGINT # handler so that the session can acknowledge the signal. sub poe_sigint { my ($object, $from, $signal_name) = @_[OBJECT, SENDER, ARG0]; print "$object->{'name'} caught SIG$signal_name from $from\n"; # did not handle the signal return 0; } #------------------------------------------------------------------------------ # This method is an event handler. It does most of counting work. It # loops by posting events back to itself. The session exits when # there is nothing left to do; this event handler causes that # condition when it stops posting events. sub poe_increment { my ($object, $kernel, $session, $heap) = @_[OBJECT, KERNEL, SESSION, HEAP]; $heap->{'counter'}++; if ($heap->{counter} % 2) { $kernel->state('runtime_state', $object, 'poe_runtime_state'); } else { $kernel->state('runtime_state'); } print "Session $object->{'name'}, iteration $heap->{'counter'}.\n"; if ($heap->{'counter'} < 5) { $kernel->post($session, 'increment'); $kernel->yield('runtime_state', $heap->{counter}); } else { # no more events. since there is nothing left to do, the session exits. } } #------------------------------------------------------------------------------ # This state is added on every even count. It's removed on every odd # one. Every count posts an event here. sub poe_runtime_state { my ($self, $iteration) = @_[OBJECT, ARG0]; print( 'Session ', $self->{name}, ' received a runtime_state event during iteration ', $iteration, "\n" ); } #============================================================================== # Create ten Counter objects, and wrap them in sessions. package main; foreach my $name (qw(one two three four five six seven eight nine ten)) { POE::Session->create( object_states => [ Counter->new($name) => { _start => 'poe_start', _stop => 'poe_stop', increment => 'poe_increment', sigint => 'poe_sigint', }, ], ); } $poe_kernel->run(); exit;
Close