Is there any difference between sockets in LUNIX and WINDOWS? I ask this because I have a code that is working in LUNIX based computer but not in a Windows one...
$sd_cmd_socket = stream_socket_client("udp://IP:PORT", $errno, $errstr, 30);
if (!$sd_cmd_socket)
{
echo "$errstr ($errno)<br />\n";
}
else
{
fwrite($sd_cmd_socket, "999999#STATUS#\n");
$rc_resp_socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_bind($rc_resp_socket, '127.0.0.1', 6003);
$rc_from = 'IP';
$rc_port = PORT;
socket_recvfrom($rc_resp_socket, $buf, 300, 0, $rc_from, $rc_port);
echo "Received $buf from remote address and remote port" . PHP_EOL;
socket_close ($rc_resp_socket);
fclose($sd_cmd_socket);
}
This scripts sends a command ("999999#STATUS#) to IP😛ORT and a logger in that IP😛ORT sends the responde back to port 6003.
This code is working fine in a LINUX based computer but not in windows... Both are using APACHE...
Any thoughts or suggestions would be appreciated...
Thanks,