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