Perhaps I am misunderstanding the PHP manual, but I'm experiencing some strange behavior with fsockopen.
To start, here's a simple script:
#!/usr/local/bin/php -q
<?
$fp = fsockopen("udp://192.168.0.1",65535,$errno,$errstr);
if (!$fp) {
echo "DOWN | $errno | $errstr\n";
} else {
echo "UP | $errno | $errstr\n";
}
?>
When I execute this, it returns "UP | 0 |", as if it has responded, but I know this is an invalid IP/Port. So shouldn't it return "DOWN..."? I've used this with TCP ports, and it works great. Thanks in advance.