For future: FIRST commit to HEAD then to branch(es).
This is for everyone of us. Not only you Jani.. :)
Derick
p.s. If the CVS rules are not followed, a bunny gets it..
On Mon, 21 Jul 2008, Jani Taskinen wrote:
> jani Mon Jul 21 13:00:27 2008 UTC
>
> Modified files:
> /php-src/ext/sockets/testsunixloop.phpt
> Log:
> - forgot to commit to HEAD
>
> http://cvs.php.net/viewvc.cgi/php-src/ext/sockets/tests/unixloop.phpt?r1=1.1&r2=1.2&diff_format=u
> Index: php-src/ext/sockets/tests/unixloop.phpt
> diff -u /dev/null php-src/ext/sockets/tests/unixloop.phpt:1.2
> --- /dev/null Mon Jul 21 13:00:27 2008
> +++ php-src/ext/sockets/tests/unixloop.phpt Mon Jul 21 13:00:27 2008
> @@ -0,0 +1,55 @@
> +--TEST--
> +Unix domain socket Loopback test
> +--SKIPIF--
> + + if (!extension_loaded('sockets')) {
> + die('skip sockets extension not available.');
> + }
> +?>
> +--FILE--
> + + $sock_path = sprintf("/tmp/%s.sock", uniqid());
> +
> + if (file_exists($sock_path))
> + die('Temporary socket already exists.');
> +
> + /* Setup socket server */
> + $server = socket_create(AF_UNIX, SOCK_STREAM, 0);
> + if (!$server) {
> + die('Unable to create AF_UNIX socket [server]');
> + }
> + if (!socket_bind($server, $sock_path)) {
> + die("Unable to bind to $sock_path");
> + }
> + if (!socket_listen($server, 2)) {
> + die('Unable to listen on socket');
> + }
> +
> + /* Connect to it */
> + $client = socket_create(AF_UNIX, SOCK_STREAM, 0);
> + if (!$client) {
> + die('Unable to create AF_UNIX socket [client]');
> + }
> + if (!socket_connect($client, $sock_path)) {
> + die('Unable to connect to server socket');
> + }
> +
> + /* Accept that connection */
> + $socket = socket_accept($server);
> + if (!$socket) {
> + die('Unable to accept connection');
> + }
> +
> + socket_write($client, "ABCdef123\n");
> +
> + $data = socket_read($socket, 10, PHP_BINARY_READ);
> + var_dump($data);
> +
> + socket_close($client);
> + socket_close($socket);
> + socket_close($server);
> + @unlink($sock_path);
> +?>
> +--EXPECT--
> +string(10) "ABCdef123
> +"
>
>
>
>
--
Derick Rethans
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php