So I've created a PHP based socket server and I just installed XAMMP so I have Apache, PHP, everything running locally.
Now when I try to run my socket server, I get the following error:
Warning: socket_bind() [function.socket-bind]: unable to bind address : Only one usage of each socket address (protocol/network address/port) is normally permitted.
Here is the code:
// Set time limit to indefinite execution
// Set the ip and port we will listen on
$address = 'xxx.xxx.xxx.xxx';
$port = 9000;
$max_readers = 10;
// Array that will hold reader information
$client = array();
// Create a TCP Stream socket
$sock = socket_create(AF_INET, SOCK_STREAM, 0);
// Bind the socket to an address/port
socket_bind($sock, $address, $port) or die('Could not bind to address');
The error is on that last line. I figure that it's because Apache is already listening on that port for incoming connections thus the reason why I cannot bind to it.
So my question is, how can I get Apache to NOT look at that port so I can use it for other incoming data?