()
| 221 | } |
| 222 | |
| 223 | private function read() |
| 224 | { |
| 225 | if ($this->bpos == $this->bsize) { |
| 226 | $this->bpos = 0; |
| 227 | $this->bsize = socket_recv($this->socket, $this->buffer, 4096, 0); |
| 228 | if ($this->bsize === false) { |
| 229 | throw $this->error("Read failed"); |
| 230 | } |
| 231 | if ($this->bsize === 0) { |
| 232 | throw $this->error("Connection closed unexpectedly"); |
| 233 | } |
| 234 | } |
| 235 | return $this->buffer[$this->bpos++]; |
| 236 | } |
| 237 | |
| 238 | private function sendCmd($code, $arg, $input) |
| 239 | { |
no test coverage detected