mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-27 07:34:41 +01:00
Improve timeout
This commit is contained in:
parent
4f1fe77ad3
commit
3fb7d6a036
@ -408,6 +408,12 @@ final class VoIPController
|
||||
}
|
||||
private function connectToAll(): void
|
||||
{
|
||||
$this->timeoutWatcher = EventLoop::repeat(10, function (): void {
|
||||
if (\microtime(true) - $this-lastIncomingTimestamp > 10) {
|
||||
$this->discard(DiscardReason::DISCONNECTED);
|
||||
}
|
||||
});
|
||||
|
||||
$promises = [];
|
||||
foreach ($this->sockets as $socket) {
|
||||
$promise = async(function () use ($socket): void {
|
||||
@ -528,12 +534,6 @@ final class VoIPController
|
||||
{
|
||||
$this->setVoipState(VoIPState::ESTABLISHED);
|
||||
|
||||
$this->timeoutWatcher = EventLoop::repeat(10, function (): void {
|
||||
if (\microtime(true) - $this->lastIncomingTimestamp > 10) {
|
||||
$this->discard(DiscardReason::DISCONNECTED);
|
||||
}
|
||||
});
|
||||
|
||||
$delay = $this->muted ? 0.2 : 0.06;
|
||||
$t = \microtime(true) + $delay;
|
||||
while (true) {
|
||||
|
Loading…
Reference in New Issue
Block a user