запускаю поочерёдно, не выводит OK
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_set_option($sock, SOL_SOCKET, SO_REUSEADDR, 1);
socket_bind($sock, '127.0.0.1', 7000);
while (socket_listen($sock, -1)) {
$conn = socket_accept($sock);
socket_write($conn,'OK');
socket_shutdown($conn);
}
socket_close($sock);
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_set_option($sock, SOL_SOCKET, SO_REUSEADDR, 1);
socket_connect($sock, '127.0.0.1', 7000);
$read = "";
$fde = "";
while($read = socket_read($sock, 1024))
{
$fde .= $read;
}
socket_close($sock);
$err = socket_last_error();
echo "good".$read.$err;