ext-uv/tests/500-udp_bind.phpt

22 lines
395 B
Plaintext
Raw Normal View History

2012-07-02 16:27:43 +02:00
--TEST--
Check for udp bind
--FILE--
<?php
$udp = uv_udp_init();
2015-01-18 02:58:40 +01:00
uv_udp_bind($udp, uv_ip4_addr('0.0.0.0', 10000));
2012-07-02 16:27:43 +02:00
2015-01-18 02:58:40 +01:00
uv_udp_recv_start($udp, function($stream, $nread, $buffer) {
2012-07-02 16:27:43 +02:00
echo "recv: " . $buffer;
uv_close($stream);
});
$uv = uv_udp_init();
2015-01-18 02:58:40 +01:00
uv_udp_send($uv, "Hello", uv_ip4_addr("0.0.0.0", 10000), function($uv, $s) {
2012-07-02 16:27:43 +02:00
uv_close($uv);
});
uv_run();
--EXPECT--
2015-01-18 02:58:40 +01:00
recv: Hello