stream_socket_server Can't assign address?
Hey!
I am trying to send a UDP packet to my UDP server. The server and client are on the same network.
The server runs off of Python and the client is made in PHP with the following code:
<?php
$socket = stream_socket_server("udp://192.168.2.7:23", $errno, $errstr, STREAM_SERVER_BIND);
if (!$socket) {
die("$errstr ($errno)");
}
do {
$pkt = stream_socket_recvfrom($socket, 1, 0, $peer);
echo "$peer\n";
stream_socket_sendto($socket, date("D M j H:i:s Y\r\n"), 0, $peer);
} while ($pkt !== false);
?>
When I try to run the code I get this error:
Warning: stream_socket_server() [function.stream-socket-server]: unable to connect to udp://192.168.2.7:23 (Can't assign requested address) in /Applications/XAMPP/xamppfiles/htdocs/sendpack.php on line 2
Can't assign requested address (0)
Both the client and server are running on OSX Lion.
I can send UDP packets just fine through Objective C.
Whats going on?
Thanks!
I have port forwarded the ports to no avail.
_________________
?Sometimes when you innovate, you make mistakes. It is best to admit them quickly, and get on with improving your other innovations.? -Steve Jobs.
Similar Topics | |
---|---|
Trump To Address Graduating Students At The University Of AL |
01 May 2025, 7:22 pm |