ConsoleReaderThread: override default socket timeout for accept

otherwise, people can break the console reader by setting the default timeout to zero or some other small value.
This commit is contained in:
Dylan K. Taylor 2021-08-03 18:48:18 +01:00
parent c567ed4b7a
commit 16965fa742
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -97,7 +97,7 @@ final class ConsoleReaderThread extends Thread{
if($sub === false){ if($sub === false){
throw new AssumptionFailedError("Something has gone horribly wrong"); throw new AssumptionFailedError("Something has gone horribly wrong");
} }
$client = stream_socket_accept($server); $client = stream_socket_accept($server, 15);
if($client === false){ if($client === false){
throw new AssumptionFailedError("stream_socket_accept() returned false"); throw new AssumptionFailedError("stream_socket_accept() returned false");
} }