note 55454 deleted from function.socket-create by nlopess
| From: | nlopess@php.net | Date: | Thu, 04 Aug 2005 10:06:26 +0000 |
| Subject: | note 55454 deleted from function.socket-create by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-93046@lists.php.net to get a copy of this message | ||
Note Submitter: kobylan at visionmedia dot sk
----
/*
*
* All3090 reset switch,
* script send udp packet and reset
* PC connected to port.
*
*/
$reseted_port_number = 0;
$udp_3090_allnet_IP = "udp://192.168.20.40";
$udp_3090_allnet_port = 12346;
$udp_3090_allnet_port = 1;//one is enought, but for test
//with multimeter could be more - 20000
$fp = fsockopen($udp_3090_allnet_IP, $udp_3090_allnet_port, $errno, $errstr);
if (!$fp) {
echo "ERROR: $errno - $errstr<br/>\n";
} else {
for($k=0;$k<$reset_lenght;$k++)
{
fwrite($fp, chr($reseted_port_number).chr(1)."\r\n");
}
fwrite($fp, chr($reseted_port_number).chr(0)."\r\n");
//sleep(5);
fclose($fp);
}