1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 17:52:16 +01:00
Files
archived-php-src/ext/sockets/tests/bug51958.phpt
Nikita Popov c5401854fc Run tidy
This should fix most of the remaining issues with tabs and spaces
being mixed in tests.
2020-09-18 14:28:32 +02:00

24 lines
595 B
PHP

--TEST--
Bug #51958: socket_accept() fails on IPv6 server sockets
--SKIPIF--
<?php
if (!extension_loaded('sockets')) {
die('skip sockets extension not available.');
}
if (!defined('IPPROTO_IPV6')) {
die('skip IPv6 not available.');
}
if (PHP_OS != "WINNT")
die('skip test relies Winsock\'s error code for WSAEWOULDBLOCK/EAGAIN');
--FILE--
<?php
$listenfd = socket_create(AF_INET6, SOCK_STREAM, SOL_TCP);
socket_bind($listenfd, "::1", 13579);
socket_listen($listenfd);
socket_set_nonblock($listenfd);
$connfd = @socket_accept($listenfd);
echo socket_last_error();
?>
--EXPECT--
10035