mirror of
https://github.com/danog/ext-uv.git
synced 2024-12-02 09:27:58 +01:00
21 lines
388 B
Plaintext
21 lines
388 B
Plaintext
|
--TEST--
|
||
|
Check for udp bind
|
||
|
--FILE--
|
||
|
<?php
|
||
|
$udp = uv_udp_init();
|
||
|
uv_udp_bind($udp, uv_ip4_addr('0.0.0.0',10000));
|
||
|
|
||
|
uv_udp_recv_start($udp,function($stream, $nread, $buffer){
|
||
|
echo "recv: " . $buffer;
|
||
|
|
||
|
uv_close($stream);
|
||
|
});
|
||
|
|
||
|
$uv = uv_udp_init();
|
||
|
uv_udp_send($uv, "Hello", uv_ip4_addr("0.0.0.0",10000),function($uv, $s){
|
||
|
uv_close($uv);
|
||
|
});
|
||
|
|
||
|
uv_run();
|
||
|
--EXPECT--
|
||
|
recv: Hello
|