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 : packagesessions.perl
#!/usr/bin/perl -w -I.. # This is a simple test of "package sessions". These are similar to # object sessions, but they work with packages instead of objects. It # is also a simpler test than sessions.perl. use strict; use lib '../lib'; use POE; #============================================================================== # Counter is a package composed of event handler functions. It is # never instantiated as an object here. package Counter; use strict; use POE::Session; # stupid scope trick, part 1 of 3 $Counter::name = ''; #------------------------------------------------------------------------------ # This is a normal subroutine, not an object method. It sets up the # session's variables and sets the session in motion. sub _start { my ($kernel, $session, $heap) = @_[KERNEL, SESSION, HEAP]; # register a signal handler $kernel->sig('INT', 'sigint'); # initialize the counter $heap->{'counter'} = 0; # stupid scope trick, part 2 of 3 $heap->{'name'} = $Counter::name; # hello, world! print "Session $heap->{'name'} started.\n"; # start things moving $kernel->post($session, 'increment'); } #------------------------------------------------------------------------------ # This is a normal subroutine, not an object method. It cleans up # after receiving POE's standard _stop event. sub _stop { my $heap = $_[HEAP]; print "Session $heap->{'name'} stopped after $heap->{'counter'} loops.\n"; } #------------------------------------------------------------------------------ # This is a normal subroutine, and not an object method. It will be # registered as a SIGINT handler so that the session can acknowledge # the signal. sub sigint { my ($heap, $from, $signal_name) = @_[HEAP, SENDER, ARG0]; print "$heap->{'name'} caught SIG$signal_name from $from\n"; # did not handle the signal return 0; } #------------------------------------------------------------------------------ # This is a normal subroutine, and not an object method. It does most # of the 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 increment { my ($package, $kernel, $session, $heap) = @_[OBJECT, KERNEL, SESSION, HEAP]; $heap->{'counter'}++; if ($heap->{counter} % 2) { $kernel->state('runtime_state', $package); } else { $kernel->state('runtime_state'); } print "Session $heap->{'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 runtime_state { my ($session, $heap, $iteration) = @_[SESSION, HEAP, ARG0]; print( 'Session ', $heap->{name}, ' received a runtime_state event during iteration ', $iteration, "\n" ); } #============================================================================== # Create ten Counter sessions, all sharing the subs in package # Counter. In a way, POE's sessions provide a simple form of object # instantiation. package main; foreach my $name (qw(one two three four five six seven eight nine ten)) { # stupid scope trick, part 3 of 3 $Counter::name = $name; # create the session POE::Session->create( package_states => [ Counter => [ qw(_start _stop increment sigint) ] ] ); } $poe_kernel->run(); exit;
Close