Esempio n. 1
0
 /**
  * @param string $data
  * @return Observable
  */
 public function write($data)
 {
     $buffer = new Buffer($this->socket, $this->loop, $data);
     // Write error close the stream
     $buffer->subscribeCallback(null, [$this, "close"], null, new EventLoopScheduler($this->loop));
     return $buffer;
 }
Esempio n. 2
0
 /**
  * @param string $data
  * @return Observable
  */
 public function write($data)
 {
     $buffer = new Buffer($this->socket, $this->loop, $data);
     // Write error close the stream, write completed wait for data
     $buffer->subscribeCallback(null, [$this, "close"], function () {
         $this->loop->addReadStream($this->socket, array($this, 'read'));
     });
     return $buffer;
 }