1--TEST--
2Support for paths in the abstract namespace (bind, connect)
3--EXTENSIONS--
4sockets
5--SKIPIF--
6<?php
7if (PHP_OS != 'Linux') {
8    die('skip For Linux only');
9}
10?>
11--FILE--
12<?php
13include __DIR__."/mcast_helpers.php.inc";
14
15$path = "\x00/foo_bar";
16
17echo "creating server socket\n";
18$servers = socket_create(AF_UNIX, SOCK_STREAM, 0) or die("err");
19socket_bind($servers, $path) or die("Could not bind");
20socket_listen($servers) or die("Could not listen");
21socket_set_nonblock($servers) or die("Could not put in non-blocking mode");
22
23echo "creating client socket\n";
24$clients = socket_create(AF_UNIX, SOCK_STREAM, 0) or die("err");
25socket_connect($clients, $path) or die("Error connecting");
26
27$conns = socket_accept($servers) or die("Could not accept connection");
28
29$r = socket_sendmsg($clients, [
30    //"name" => [ "addr" => $path, ],
31    "iov" => ["test ", "thing", "\n"],
32], 0);
33var_dump($r);
34checktimeout($conns, 500);
35
36if (!socket_recv($conns, $buf, 20, 0)) die("recv");
37print_r($buf);
38?>
39--EXPECT--
40creating server socket
41creating client socket
42int(11)
43test thing
44