mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-27 07:34:41 +01:00
Shutdown wrappers, too
This commit is contained in:
parent
d558d17d1f
commit
5779732cd0
@ -118,10 +118,11 @@ abstract class ClientAbstract
|
||||
*
|
||||
* @return Promise
|
||||
*/
|
||||
public function disconnect(): Promise
|
||||
public function disconnect(): \Generator
|
||||
{
|
||||
$this->run = false;
|
||||
return $this->server->disconnect();
|
||||
yield $this->server->disconnect();
|
||||
yield \array_map(fn (ChannelledSocket $w): Promise => $w->disconnect(), $this->wrappers);
|
||||
}
|
||||
/**
|
||||
* Call function.
|
||||
|
@ -144,7 +144,9 @@ class Server extends SignalLoop
|
||||
Tools::callFork($this->clientLoop($socket));
|
||||
}
|
||||
$this->server->close();
|
||||
if (isset($this->callback)) $this->callback->signal(null);
|
||||
if (isset($this->callback)) {
|
||||
$this->callback->signal(null);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Client handler loop.
|
||||
|
Loading…
Reference in New Issue
Block a user