[Xml-compile] Making HTTPDaemon work on win32 (somehow)
Robin V.
robinsp at gmail.com
Mon Mar 15 20:34:29 GMT 2010
Here's a way to make Net::Server work (or nearly...) with win32
(strawberry perl).
This is not clean, this does not fully work, but it permits to the
daemon to start, which is a step in the good direction...
1. Edit Net::Server::Daemonize :
Remove posix calls in 233-235
my $sigset;
# my $sigset = POSIX::SigSet->new(SIGINT);
# POSIX::sigprocmask(SIG_BLOCK, $sigset)
# or die "Can't block SIGINT for fork: [$!]\n";
and in 247-248:
# POSIX::sigprocmask(SIG_UNBLOCK, $sigset)
# or die "Can't unblock SIGINT for fork: [$!]\n";
comment line 298:
# POSIX::setsid();
2. In your code, change the forking model of Net::Daemon
my $daemon = XML::Compile::SOAP::HTTPDaemon->new(based_on =>
'Net::Server::Fork');
or (probably safer)
my $daemon = XML::Compile::SOAP::HTTPDaemon->new(based_on =>
'Net::Server::Single');
3. Run Net::Daemon with no background and no setsid options:
$daemon->run( port => 8889, background => "", setsid => "" );
Here it goes:
notice: Process Backgrounded
notice: 2010/03/15-21:16:20 XML::Compile::SOAP::HTTPDaemon (type
XML::Compile::SOAP::Daemon) starting! pid(-4920)
notice: Binding to TCP port 8889 on host *
warning: Group Not Defined. Defaulting to EGID '0'
warning: User Not Defined. Defaulting to EUID '0'
info: 2010/03/15-21:17:14 CONNECT TCP Peer: "127.0.0.1:52464" Local:
"127.0.0.1:8889"
In fact, there's still problems with Time::HiRes::alarm not
implemented in my strawberry perl 5.10.1 (this bug should be gone now
with newer version of strawberry perl 5.11.x).
Replacing "use Time::HiRes qw/time alarm/;"
with "use Time::HiRes qw/time/;"
doesn't help much as the clients receive the message:
[422] The XML cannot be parsed: Can't call method "parse_string" on
unblessed reference at
C:/strawberry/perl/site/lib/XML/Compile/SOAP/Daemon.pm line 156
I fear I have commented too much things.
To be continued... :)
More information about the Xml-compile
mailing list