blob: 401c65bce05e69e5f6969f206a147f8bf149efc5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
--TEST--
stream context tcp_nodelay
--SKIPIF--
<?php
if (getenv("SKIP_ONLINE_TESTS")) die("skip online test");
if (!extension_loaded("sockets")) die("skip: need sockets");
?>
--FILE--
<?php
$ctxt = stream_context_create([
"socket" => [
"tcp_nodelay" => true
]
]);
$stream = stream_socket_client(
"tcp://www.php.net:80", $errno, $errstr, 10, STREAM_CLIENT_CONNECT, $ctxt);
$socket =
socket_import_stream($stream);
var_dump(socket_get_option($socket, SOL_TCP, TCP_NODELAY) > 0);
?>
--EXPECT--
bool(true)
|