mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 21:45:35 +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");
|
throw new \RuntimeException("Failed to connect to server process");
|
||||||
}
|
}
|
||||||
$consoleReader = new ConsoleReader();
|
$consoleReader = new ConsoleReader();
|
||||||
while(true){
|
while(!feof($socket)){
|
||||||
$line = $consoleReader->readLine();
|
$line = $consoleReader->readLine();
|
||||||
if($line !== null){
|
if($line !== null){
|
||||||
fwrite($socket, $line . "\n");
|
fwrite($socket, $line . "\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user