1--TEST--
2Server processing multiple request at the same time
3--SKIPIF--
4<?php
5include "skipif.inc";
6?>
7--FILE--
8<?php
9include "php_cli_server.inc";
10php_cli_server_start();
11
12$fd = stream_socket_client("tcp://" . PHP_CLI_SERVER_ADDRESS);
13fwrite($fd, "GET /index.php HTTP/1.0\r\nHost: hello");
14
15$fd2 = stream_socket_client("tcp://" . PHP_CLI_SERVER_ADDRESS);
16fwrite($fd2, "GET /index.php HTTP/1.0\r\nConnection: close\r\n\r\n");
17
18stream_copy_to_stream($fd2, STDOUT);
19
20fwrite($fd, "\r\n\r\n");
21stream_copy_to_stream($fd, STDOUT);
22
23echo PHP_EOL;
24
25?>
26===DONE===
27--EXPECTF--
28HTTP/1.0 200 OK
29Date: %s
30Connection: close
31X-Powered-By: %s
32Content-type: text/html; charset=UTF-8
33
34Hello worldHTTP/1.0 200 OK
35Host: hello
36Date: %s
37Connection: close
38X-Powered-By: %s
39Content-type: text/html; charset=UTF-8
40
41Hello world
42===DONE===
43