mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
7373ce9149
Feature request was to expose getaddrinfo(). I accomplish this by having an array of resources that are the addrinfo structures. The resources can be used in new functions to connect/bind, and one function to examine the contents of the resource.
19 lines
393 B
PHP
19 lines
393 B
PHP
--TEST--
|
|
Test socket_addrinfo_bind()
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('sockets')) {
|
|
die('SKIP The sockets extension is not loaded.');
|
|
}
|
|
--FILE--
|
|
<?php
|
|
$addrinfo = socket_addrinfo_lookup('127.0.0.1', 2000, array(
|
|
'ai_family' => AF_INET,
|
|
'ai_socktype' => SOCK_DGRAM,
|
|
));
|
|
var_dump(socket_addrinfo_bind($addrinfo[0]));
|
|
echo "Done";
|
|
--EXPECTF--
|
|
resource(%d) of type (Socket)
|
|
Done
|