2 message parser with nonblocking stream
11 $parser = new http\Message\Parser;
12 $socket = stream_socket_pair(STREAM_PF_UNIX, STREAM_SOCK_STREAM, STREAM_IPPROTO_IP);
13 stream_set_blocking($socket[0], 0);
18 "Content-length: 3\n",
24 $line = array_shift($message);
25 $parser->stream($socket[0], 0, $msg);
26 fwrite($socket[1], $line);
27 $parser->stream($socket[0], 0, $msg);
30 var_dump($msg, (string) $msg->getBody());
36 object(http\Message)#%d (9) {
40 object(http\Message\Body)#%d (0) {
42 ["requestMethod":protected]=>
44 ["requestUrl":protected]=>
46 ["responseStatus":protected]=>
48 ["responseCode":protected]=>
50 ["httpVersion":protected]=>
52 ["headers":protected]=>
58 ["X-Original-Content-Length"]=>
61 ["parentMessage":protected]=>