| @@ 184-201 (lines=18) @@ | ||
| 181 | * @override |
|
| 182 | * @inheritDoc |
|
| 183 | */ |
|
| 184 | public function read($length = null) |
|
| 185 | { |
|
| 186 | if (!$this->readable) |
|
| 187 | { |
|
| 188 | return $this->throwAndEmitException( |
|
| 189 | new ReadException('Stream is no longer readable.') |
|
| 190 | ); |
|
| 191 | } |
|
| 192 | ||
| 193 | if (!$this->reading && !$this->paused) |
|
| 194 | { |
|
| 195 | $this->reading = true; |
|
| 196 | $this->readingStarted = true; |
|
| 197 | $this->loop->addReadStream($this->resource, $this->getHandleReadFunction()); |
|
| 198 | } |
|
| 199 | ||
| 200 | return ''; |
|
| 201 | } |
|
| 202 | ||
| 203 | /** |
|
| 204 | * @override |
|
| @@ 129-146 (lines=18) @@ | ||
| 126 | * @override |
|
| 127 | * @inheritDoc |
|
| 128 | */ |
|
| 129 | public function read($length = null) |
|
| 130 | { |
|
| 131 | if (!$this->readable) |
|
| 132 | { |
|
| 133 | return $this->throwAndEmitException( |
|
| 134 | new ReadException('Stream is no longer readable.') |
|
| 135 | ); |
|
| 136 | } |
|
| 137 | ||
| 138 | if (!$this->reading && !$this->paused) |
|
| 139 | { |
|
| 140 | $this->reading = true; |
|
| 141 | $this->readingStarted = true; |
|
| 142 | $this->loop->addReadStream($this->resource, $this->getHandleReadFunction()); |
|
| 143 | } |
|
| 144 | ||
| 145 | return ''; |
|
| 146 | } |
|
| 147 | ||
| 148 | /** |
|
| 149 | * Handle the incoming stream. |
|