Hi,
the problem is not in HTTP::Server::Simple itself, the problem is that
perl on Win32 implements "fork" call as an emulation via threads; thus
it behaves slightly differently than to UNIX systems.
In this case of cookies.t:
- when calling "TestServer->spawn()"
- it calls "HTTP::Server::Simple->background()"
- that invokes "fork" call
- in cookies.t we got back $pid that is in fact not a real PID
corresponding to a real MS Windows process
- $pid is a pseudo-value, as the forked process is not a real process
but a thread
- a hang-up point occures when we are gonna send SIGTERM signal to this $pid
I do not know why but on Win32 sending SIGTERM(15) to forked process (in
fact thread) hangs up (at least with our TestServer); however sending
SIGKILL(9) works fine. Therefore the following "ditry patch" to
cookies.t solves the issue:
- my $nprocesses = kill 15, $pid;
+ my $nprocesses = kill 9, $pid;
--
kmx