mirror of
https://github.com/danog/ext-uv.git
synced 2024-11-26 20:14:47 +01:00
add gethostbyname example
This commit is contained in:
parent
a3a1cc887c
commit
4bb3eea336
14
examples/gethostbyname.php
Normal file
14
examples/gethostbyname.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
$uv = uv_ares_init_options(uv_default_loop(), array(
|
||||||
|
"servers" => array(
|
||||||
|
"8.8.8.8"
|
||||||
|
),
|
||||||
|
"port"=>53
|
||||||
|
),null);
|
||||||
|
|
||||||
|
ares_gethostbyname($uv,"google.com",AF_INET, function($name, $addr){
|
||||||
|
var_dump($name);
|
||||||
|
var_dump($addr);
|
||||||
|
});
|
||||||
|
|
||||||
|
uv_run();
|
Loading…
Reference in New Issue
Block a user