xref: /php-uv/tests/500-udp_bind.phpt (revision e76ac0dc)
1--TEST--
2Check for udp bind
3--FILE--
4<?php
5$udp = uv_udp_init();
6uv_udp_bind($udp, uv_ip4_addr('0.0.0.0', 10000));
7
8uv_udp_recv_start($udp, function($stream, $buffer) {
9    echo "recv: " .  $buffer;
10
11    uv_close($stream);
12});
13
14$uv = uv_udp_init();
15uv_udp_send($uv, "Hello", uv_ip4_addr("0.0.0.0", 10000), function($uv, $s) {
16    uv_close($uv);
17});
18
19uv_run();
20--EXPECT--
21recv: Hello
22