I have the following problem. I create a socket on a port. I set it to listen and than I want to connect to that socket. If someone connects, all goes fine. But if the connection doesn't come, my script stays waiting untill someone connects. I don't have any wrong loops but he just waits at socket_accept() untill a connection is made. It's very strange. Who can help me??
Code where it goes wrong:
if (($msgsock = socket_accept($sock)) < 0) {
echo "socket_accept() failed: reason: " . socket_strerror($msgsock) . "\n";
}