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