mirror of
https://github.com/danog/ipc.git
synced 2024-11-26 20:15:05 +01:00
Small bugfix
This commit is contained in:
parent
a44e077f2d
commit
62eeba222c
@ -94,12 +94,11 @@ final class ChannelledSocket implements Channel
|
|||||||
if ($this->closed) {
|
if ($this->closed) {
|
||||||
return new Success();
|
return new Success();
|
||||||
}
|
}
|
||||||
$this->closed = true;
|
|
||||||
return call(function (): \Generator {
|
return call(function (): \Generator {
|
||||||
yield $this->channel->send(new ChannelCloseReq);
|
|
||||||
if ($this->reading) {
|
if ($this->reading) {
|
||||||
$this->closePromise = new Deferred;
|
$this->closePromise = new Deferred;
|
||||||
}
|
}
|
||||||
|
yield $this->channel->send(new ChannelCloseReq);
|
||||||
do {
|
do {
|
||||||
$data = yield ($this->closePromise ? $this->closePromise->promise() : $this->channel->receive());
|
$data = yield ($this->closePromise ? $this->closePromise->promise() : $this->channel->receive());
|
||||||
if ($this->closePromise) {
|
if ($this->closePromise) {
|
||||||
@ -113,6 +112,7 @@ final class ChannelledSocket implements Channel
|
|||||||
}
|
}
|
||||||
} while ($this->state !== self::GOT_ALL_MASK);
|
} while ($this->state !== self::GOT_ALL_MASK);
|
||||||
|
|
||||||
|
$this->closed = true;
|
||||||
|
|
||||||
$this->close();
|
$this->close();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user