2 function my_cool_callback($requests) {
3 $requests['HTTP_CONNECTION'] = isset($requests['HTTP_CONNECTION']) ?
$requests['HTTP_CONNECTION'] : 'close';
5 $output = "Hello World! PID: " . getMyPid();
6 $answer = array('status_code' => '200 OK',
7 'connection' => $requests['HTTP_CONNECTION'],
8 'content-type' => 'text/html',
9 'content-length' => strlen($output),
17 while( $cntChildren < $maxChildren ) {
23 echo "Warning: Cannot spawn child process!!!\n";
27 echo '[' . getMyPid() . '] Child process listening on port ' . $startport . "\n";
28 mistral_init('0.0.0.0', $startport, 5);
29 mistral_register_callback('my_cool_callback');