I've been trying to run the tcp server sample from the docs, which starts like this:
if (($sock = socket (AF_INET, SOCK_STREAM, 0)) < 0) {
echo "socket() failed: reason: " . strerror ($sock) . "\n";
}
if (($ret = bind ($sock, $address, $port)) < 0) {
echo "bind() failed: reason: " . strerror ($ret) . "\n";
}
if (($ret = listen ($sock, 5)) < 0) {
echo "listen() failed: reason: " . strerror ($ret) . "\n";
}
$adress is some ip and $port something like 3600 or what you want. unfortunately, bind() returns an error stating:
bind() failed: reason: Invalid argument
but I can't see what I'm doing wrong here...
any help appreciated. thanks.