| @@ 684-699 (lines=16) @@ | ||
| 681 | * @param string $data Data to send |
|
| 682 | * @return boolean Success |
|
| 683 | */ |
|
| 684 | public function writeln($data) |
|
| 685 | { |
|
| 686 | if (!$this->alive) { |
|
| 687 | Daemon::log('Attempt to write to dead IOStream (' . get_class($this) . ')'); |
|
| 688 | return false; |
|
| 689 | } |
|
| 690 | if (!isset($this->bev)) { |
|
| 691 | return false; |
|
| 692 | } |
|
| 693 | if (!mb_orig_strlen($data) && !mb_orig_strlen($this->EOL)) { |
|
| 694 | return true; |
|
| 695 | } |
|
| 696 | $this->writing = true; |
|
| 697 | $this->bev->write($data); |
|
| 698 | $this->bev->write($this->EOL); |
|
| 699 | return true; |
|
| 700 | } |
|
| 701 | ||
| 702 | /** |
|
| @@ 450-465 (lines=16) @@ | ||
| 447 | * @param string Data to send |
|
| 448 | * @return boolean Success |
|
| 449 | */ |
|
| 450 | public function writeln($data) |
|
| 451 | { |
|
| 452 | if (!$this->alive) { |
|
| 453 | Daemon::log('Attempt to write to dead IOStream (' . get_class($this) . ')'); |
|
| 454 | return false; |
|
| 455 | } |
|
| 456 | if (!isset($this->bevWrite)) { |
|
| 457 | return false; |
|
| 458 | } |
|
| 459 | if (!mb_orig_strlen($data) && !mb_orig_strlen($this->EOL)) { |
|
| 460 | return true; |
|
| 461 | } |
|
| 462 | $this->writing = true; |
|
| 463 | $this->bevWrite->write($data); |
|
| 464 | $this->bevWrite->write($this->EOL); |
|
| 465 | return true; |
|
| 466 | } |
|
| 467 | ||
| 468 | /** |
|