int pid_bind ( int $pid [, string $addr = "", int $port = 0 ] )
pid_bind() binds a name. This bind function is necessary before using UDP reception.
※ available F/W version : all
Returns 0 on success, PHP error on error.
<?php
$buf = "Hello PHPoC!";
$peer_addr = "10.3.0.10";
$peer_port = 1470;
$pid = pid_open("/mmap/udp0");
pid_bind($pid, "", 1470);
$wlen = pid_sendto($pid, $buf, strlen($buf), 0, $peer_addr, $peer_port);
echo "udp sent ($wlen bytes)\r\n";
?>
pid_open() / pid_ioctl() / pid_sendto() / pid_recvfrom()
None