| @@ 318-327 (lines=10) @@ | ||
| 315 | * |
|
| 316 | * @return string |
|
| 317 | */ |
|
| 318 | public function read($length, $type = PHP_BINARY_READ) |
|
| 319 | { |
|
| 320 | $return = @socket_read($this->resource, $length, $type); |
|
| 321 | ||
| 322 | if ($return === false) { |
|
| 323 | throw new SocketException($this->resource); |
|
| 324 | } |
|
| 325 | ||
| 326 | return $return; |
|
| 327 | } |
|
| 328 | ||
| 329 | /** |
|
| 330 | * @param $buffer |
|
| @@ 338-347 (lines=10) @@ | ||
| 335 | * |
|
| 336 | * @return int |
|
| 337 | */ |
|
| 338 | public function receive(&$buffer, $length, $flags) |
|
| 339 | { |
|
| 340 | $return = @socket_recv($this->resource, $buffer, $length, $flags); |
|
| 341 | ||
| 342 | if ($return === false) { |
|
| 343 | throw new SocketException($this->resource); |
|
| 344 | } |
|
| 345 | ||
| 346 | return $return; |
|
| 347 | } |
|
| 348 | ||
| 349 | /** |
|
| 350 | * @param Socket[] &$read |
|