5
5
--SKIPIF--
6
6
<?php
7
7
if (!function_exists ("proc_open " )) die ("skip no proc_open " );
8
- if (substr (PHP_OS , 0 , 3 ) == 'WIN ' ) {
9
- die ('skip sockets ext currently does not work in worker on Windows ' );
10
- }
11
8
?>
12
9
--FILE--
13
10
<?php
@@ -24,20 +21,40 @@ $serverCode = <<<'CODE'
24
21
25
22
$conn = stream_socket_accept($server);
26
23
27
- $si = socket_get_option(socket_import_stream($server), SOL_TCP, TCP_NODELAY) > 0 ? "nodelay": "delay";
24
+ phpt_notify(message:"server-accepted");
25
+
26
+ $is = socket_import_stream($server);
27
+ phpt_notify(message:"server-imported");
28
+
29
+ $si = socket_get_option($is, SOL_TCP, TCP_NODELAY) > 0 ? "nodelay": "delay";
30
+
31
+ phpt_notify(message:"si:$si");
32
+
33
+ $ic = socket_import_stream($conn);
34
+ phpt_notify(message:"conn-imported");
35
+
28
36
$ci = socket_get_option(socket_import_stream($conn), SOL_TCP, TCP_NODELAY) > 0 ? "nodelay": "delay";
29
37
30
38
phpt_notify(message:"server-$si:conn-$ci");
31
39
CODE;
32
40
33
41
$ clientCode = <<<'CODE'
42
+ echo "client start: {{ ADDR }}\n";
34
43
$test = stream_socket_client("tcp://{{ ADDR }}", $errno, $errstr, 10);
35
-
44
+ echo phpt_wait();
45
+ echo phpt_wait();
46
+ echo phpt_wait();
47
+ echo phpt_wait();
36
48
echo phpt_wait();
37
49
CODE;
38
50
39
51
include sprintf ("%s/../../../openssl/tests/ServerClientTestCase.inc " , __DIR__ );
40
52
ServerClientTestCase::getInstance ()->run ($ clientCode , $ serverCode );
41
53
?>
42
- --EXPECT--
54
+ --EXPECTF--
55
+ client start: 127.0.0.1:%d
56
+ server-accepted
57
+ server-imported
58
+ si:delay
59
+ conn-imported
43
60
server-delay:conn-nodelay
0 commit comments