diff options
Diffstat (limited to 'ext/standard/tests/file/fgets_socket_variation1.phpt')
-rw-r--r-- | ext/standard/tests/file/fgets_socket_variation1.phpt | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/standard/tests/file/fgets_socket_variation1.phpt b/ext/standard/tests/file/fgets_socket_variation1.phpt index 57944d8b5..429ad67d6 100644 --- a/ext/standard/tests/file/fgets_socket_variation1.phpt +++ b/ext/standard/tests/file/fgets_socket_variation1.phpt @@ -5,11 +5,17 @@ Dave Kelsey <d_kelsey@uk.ibm.com> --FILE-- <?php -/* Setup socket server */ -$server = stream_socket_server('tcp://127.0.0.1:31337'); +for ($i=0; $i<100; $i++) { + $port = rand(10000, 65000); + /* Setup socket server */ + $server = @stream_socket_server("tcp://127.0.0.1:$port"); + if ($server) { + break; + } +} /* Connect to it */ -$client = fsockopen('tcp://127.0.0.1:31337'); +$client = fsockopen("tcp://127.0.0.1:$port"); if (!$client) { die("Unable to create socket"); |