Small bugfix

This commit is contained in:
Daniil Gentili 2019-05-12 14:07:46 +02:00
parent 1b88769aef
commit 7dae233bf7
2 changed files with 4 additions and 0 deletions

View File

@ -114,6 +114,9 @@ class ReadLoop extends SignalLoop
$API = $this->API;
$datacenter = $this->datacenter;
$connection = $this->connection;
if (isset($this->connection->old)) {
throw new NothingInTheSocketException();
}
try {
$buffer = yield $connection->stream->getReadBuffer($payload_length);

View File

@ -25,6 +25,7 @@ use danog\MadelineProto\Stream\Async\RawStream;
use danog\MadelineProto\Stream\ConnectionContext;
use function Amp\call;
use function Amp\Socket\connect;
use danog\MadelineProto\NothingInTheSocketException;
/**
* Buffered raw stream.