mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
ConsoleReaderChildProcess: die voluntarily if connection to server process is closed
this happens if the parent process is killed via SIGINT, because its stdin will be closed, interrupting a blocking read. This might also happen if the user pressed CTRL+D, so we don't die unless end of socket stream was also detected. closes #4335
This commit is contained in:
parent
1afda04620
commit
c7bb77e24a
@ -41,7 +41,7 @@ if($socket === false){
|
||||
throw new \RuntimeException("Failed to connect to server process");
|
||||
}
|
||||
$consoleReader = new ConsoleReader();
|
||||
while(true){
|
||||
while(!feof($socket)){
|
||||
$line = $consoleReader->readLine();
|
||||
if($line !== null){
|
||||
fwrite($socket, $line . "\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user