This commit is contained in:
Daniil Gentili 2019-06-25 18:02:56 +02:00
parent 949bd194ed
commit 214fc0d0f9

View File

@ -18,6 +18,8 @@
namespace danog\MadelineProto\Loop\Connection;
use Amp\ByteStream\PendingReadError;
use Amp\ByteStream\StreamException;
use Amp\Loop;
use Amp\Websocket\ClosedException;
use danog\MadelineProto\Logger;
@ -25,7 +27,6 @@ use danog\MadelineProto\Loop\Impl\SignalLoop;
use danog\MadelineProto\MTProtoTools\Crypt;
use danog\MadelineProto\NothingInTheSocketException;
use danog\MadelineProto\Tools;
use Amp\ByteStream\StreamException;
/**
* Socket read loop.
@ -57,7 +58,7 @@ class ReadLoop extends SignalLoop
while (true) {
try {
$error = yield $this->waitSignal($this->readMessage());
} catch (NothingInTheSocketException|StreamException $e) {
} catch (NothingInTheSocketException | StreamException | PendingReadError $e) {
if (isset($connection->old)) {
return;
}
@ -65,10 +66,6 @@ class ReadLoop extends SignalLoop
$API->logger->logger("Got nothing in the socket in DC {$datacenter}, reconnecting...", Logger::ERROR);
yield $connection->reconnect();
continue;
} catch (ClosedException $e) {
$API->logger->logger($e->getMessage(), Logger::FATAL_ERROR);
throw $e;
}
if (is_int($error)) {