Avoid use of random ports in some socket tests

This commit is contained in:
Nikita Popov 2019-07-03 12:47:49 +02:00
parent a023eb3967
commit d6d9024cb8
6 changed files with 8 additions and 14 deletions

View File

@ -14,9 +14,8 @@ fa@php.net
?>
--FILE--
<?php
$rand = rand(1,999);
$s_c = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$s_bind = socket_bind($s_c, '0.0.0.0', 31330+$rand);
$s_bind = socket_bind($s_c, '0.0.0.0');
var_dump($s_bind);
// Connect to destination address

View File

@ -1,5 +1,5 @@
--TEST--
ext/sockets - socket_getsockname - basic test
ext/sockets - socket_getpeername - basic test
--CREDITS--
Florian Anderiasch
fa@php.net
@ -11,9 +11,8 @@ fa@php.net
?>
--FILE--
<?php
$rand = rand(1,999);
$s_c = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$s_bind = socket_bind($s_c, '0.0.0.0', 31330+$rand);
$s_bind = socket_bind($s_c, '0.0.0.0');
var_dump($s_bind);
// Connect to destination address

View File

@ -11,9 +11,8 @@ fa@php.net
?>
--FILE--
<?php
$rand = rand(1,999);
$s_c = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$s_bind = socket_bind($s_c, '0.0.0.0', 31330+$rand);
$s_bind = socket_bind($s_c, '0.0.0.0');
var_dump($s_bind);
// Connect to destination address

View File

@ -8,8 +8,7 @@ ext/sockets - socket_send - test with incorrect parameters
?>
--FILE--
<?php
$rand = rand(1,999);
$s_c = socket_create_listen(31330+$rand);
$s_c = socket_create_listen(0);
$s_w = socket_send($s_c, "foo", -1, MSG_OOB);
socket_close($s_c);
?>

View File

@ -8,8 +8,7 @@ ext/sockets - socket_sendto - test with incorrect parameters
?>
--FILE--
<?php
$rand = rand(1,999);
$s_c = socket_create_listen(31330+$rand);
$s_c = socket_create_listen(0);
$s_w = socket_sendto($s_c, "foo", -1, MSG_OOB, '127.0.0.1');
socket_close($s_c);
?>

View File

@ -11,11 +11,10 @@ fa@php.net
?>
--FILE--
<?php
$rand = rand(1,999);
$s_c_l = socket_create_listen(31330+$rand);
$s_c_l = socket_create_listen(0);
socket_set_nonblock($s_c_l);
var_dump($s_c_l);
#socket_accept($s_c_l);
//socket_accept($s_c_l);
socket_close($s_c_l);
?>
--EXPECTF--