@@ 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 | /** |
@@ 529-544 (lines=16) @@ | ||
526 | * |
|
527 | * @return boolean Success |
|
528 | */ |
|
529 | public function writeln ($data) |
|
530 | { |
|
531 | if (!$this->alive) { |
|
532 | Daemon::log('Attempt to write to dead IOStream (' . get_class($this) . ')'); |
|
533 | ||
534 | return false; |
|
535 | } |
|
536 | if (!isset($this->bevWrite)) { |
|
537 | return false; |
|
538 | } |
|
539 | if (!mb_orig_strlen($data) && !mb_orig_strlen($this->EOL)) { |
|
540 | return true; |
|
541 | } |
|
542 | $this->writing = true; |
|
543 | $this->bevWrite->write($data); |
|
544 | $this->bevWrite->write($this->EOL); |
|
545 | ||
546 | return true; |
|
547 | } |