@@ 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 | /** |
@@ 687-702 (lines=16) @@ | ||
684 | * @param string $data Data to send |
|
685 | * @return boolean Success |
|
686 | */ |
|
687 | public function writeln($data) |
|
688 | { |
|
689 | if (!$this->alive) { |
|
690 | Daemon::log('Attempt to write to dead IOStream (' . get_class($this) . ')'); |
|
691 | return false; |
|
692 | } |
|
693 | if (!isset($this->bev)) { |
|
694 | return false; |
|
695 | } |
|
696 | if (!mb_orig_strlen($data) && !mb_orig_strlen($this->EOL)) { |
|
697 | return true; |
|
698 | } |
|
699 | $this->writing = true; |
|
700 | $this->bev->write($data); |
|
701 | $this->bev->write($this->EOL); |
|
702 | return true; |
|
703 | } |
|
704 | ||
705 | /** |