mirror of
https://github.com/php/php-src.git
synced 2024-09-30 22:36:12 +00:00
41 lines
905 B
Plaintext
41 lines
905 B
Plaintext
|
--TEST--
|
||
|
Support for paths in the abstract namespace (bind, sendmsg, recvmsg)
|
||
|
--SKIPIF--
|
||
|
<?php
|
||
|
if (!extension_loaded('sockets'))
|
||
|
die('skip sockets extension not available.');
|
||
|
|
||
|
if (PHP_OS != 'Linux') {
|
||
|
die('skip For Linux only');
|
||
|
}
|
||
|
?>
|
||
|
--FILE--
|
||
|
<?php
|
||
|
include __DIR__."/mcast_helpers.php.inc";
|
||
|
|
||
|
$path = "\x00/bar_foo";
|
||
|
|
||
|
echo "creating send socket\n";
|
||
|
$sends1 = socket_create(AF_UNIX, SOCK_DGRAM, 0) or die("err");
|
||
|
socket_set_nonblock($sends1) or die("Could not put in non-blocking mode");
|
||
|
|
||
|
echo "creating receive socket\n";
|
||
|
$s = socket_create(AF_UNIX, SOCK_DGRAM, 0) or die("err");
|
||
|
socket_bind($s, $path) or die("err");
|
||
|
|
||
|
$r = socket_sendmsg($sends1, [
|
||
|
"name" => [ "path" => $path],
|
||
|
"iov" => ["test ", "thing", "\n"],
|
||
|
], 0);
|
||
|
var_dump($r);
|
||
|
checktimeout($s, 500);
|
||
|
|
||
|
if (!socket_recv($s, $buf, 20, 0)) die("recv");
|
||
|
print_r($buf);
|
||
|
?>
|
||
|
--EXPECTF--
|
||
|
creating send socket
|
||
|
creating receive socket
|
||
|
int(11)
|
||
|
test thing
|