File: soap.daemon.forkafterprocessing

package info (click to toggle)
libsoap-lite-perl 0.712-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,740 kB
  • ctags: 831
  • sloc: perl: 10,860; xml: 90; makefile: 23; cs: 16
file content (25 lines) | stat: -rw-r--r-- 1,081 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!perl -w
#!d:\perl\bin\perl.exe 

eval { require SOAP::Transport::HTTP::Daemon::ForkAfterProcessing } or die <<EOW;
$@
  WARNING: module for Daemon::ForkAfterProcessing is not installed by default.
  It's in examples/SOAP/Transport/HTTP/ directory
  you can install it yourself.
  Forking behavior IS specific: it is forking AFTER handling request.
  Feel free to modify this behavior. It's just an example.
EOW

$SIG{PIPE} = $SIG{INT} = 'IGNORE'; # don't want to die on 'Broken pipe' or Ctrl-C
$SIG{CHLD} = 'IGNORE';             # do not create zombies

my $daemon = SOAP::Transport::HTTP::Daemon::ForkAfterProcessing
  -> new (LocalAddr => 'localhost', LocalPort => 80)
  # you may also add other options, like 'Reuse' => 1 and/or 'Listen' => 128
  # specify list of objects-by-reference here 
  -> objects_by_reference(qw(My::PersistentIterator My::SessionIterator My::Chat))
  # specify path to My/Examples.pm here
  -> dispatch_to('/Your/Path/To/Deployed/Modules', 'Module::Name', 'Module::method') 
;
print "Contact to SOAP server at ", $daemon->url, "\n";
$daemon->handle;