The following code sends out a UDP packet when I run it from my Linux server with the address of my web client udp://192.168.1.107:2159. However, when I call the same web page from the client with the address Linux server address shown in the code, NO UDP packet is emitted. I tried both a PC client with chrome and a Mac client with Safari. Also, the phpinfo() shows that allow_url_fopen is "On". Also, I tried the code without the fflush() function too.
Is there restrictions on Client web pages and PHP sockets? I don't see this searching the net. By the way, I coded a Java app on the same client machine and it sends the UDP packet to the address and port without problem.
phpinfo();
$errno = 0;
$errstr = "";
$fsocket = fsockopen("udp://192.168.1.103:2195", $errno, $errstr);
if( !$fsocket ) {
echo "$errstr( $errno)<br/>
";
} else {
$out = "Oh ya baby!
";
fwrite( $fsocket, $out );
fflush( $fsocket );
fclose($fsocket);
}