xref: /php-src/ext/sockets/tests/bug51958.phpt (revision f39b5c4c)
1--TEST--
2Bug #51958: socket_accept() fails on IPv6 server sockets
3--EXTENSIONS--
4sockets
5--SKIPIF--
6<?php
7
8if (!defined('IPPROTO_IPV6')) {
9    die('skip IPv6 not available.');
10}
11if (PHP_OS != "WINNT")
12    die('skip test relies Winsock\'s error code for WSAEWOULDBLOCK/EAGAIN');
13?>
14--FILE--
15<?php
16$listenfd = socket_create(AF_INET6, SOCK_STREAM, SOL_TCP);
17socket_bind($listenfd, "::1", 13579);
18socket_listen($listenfd);
19socket_set_nonblock($listenfd);
20$connfd = @socket_accept($listenfd);
21echo socket_last_error();
22?>
23--EXPECT--
2410035
25