ignore any errors while trying to send the close command, the process might already be dead

This commit is contained in:
Robin Appelman 2020-03-24 19:13:02 +01:00
commit 4411326dde

View file

@ -117,8 +117,9 @@ class Connection extends RawConnection {
} }
public function close($terminate = true) { public function close($terminate = true) {
if (is_resource($this->getInputStream())) { if (get_resource_type($this->getInputStream()) === 'stream') {
$this->write('close' . PHP_EOL); // ignore any errors while trying to send the close command, the process might already be dead
@$this->write('close' . PHP_EOL);
} }
parent::close($terminate); parent::close($terminate);
} }