Пример #1
0
 public function flush()
 {
     if (strlen($this->wBuf_) > 0) {
         $this->transport_->write($this->wBuf_);
         $this->wBuf_ = '';
     }
     $this->transport_->flush();
 }
Пример #2
0
 /**
  * Writes the output buffer to the stream in the format of a 4-byte length
  * followed by the actual data.
  */
 public function flush()
 {
     if (!$this->write_) {
         return $this->transport_->flush();
     }
     $out = pack('N', strlen($this->wBuf_));
     $out .= $this->wBuf_;
     $this->transport_->write($out);
     $this->transport_->flush();
     $this->wBuf_ = '';
 }
Пример #3
0
 /**
  * Writes the output buffer to the stream in the format of a 4-byte length
  * followed by the actual data.
  */
 public function flush()
 {
     if (!$this->write_) {
         return $this->transport_->flush();
     }
     $out = pack('N', strlen($this->wBuf_));
     $out .= $this->wBuf_;
     // Note that we clear the internal wBuf_ prior to the underlying write
     // to ensure we're in a sane state (i.e. internal buffer cleaned)
     // if the underlying write throws up an exception
     $this->wBuf_ = '';
     $this->transport_->write($out);
     $this->transport_->flush();
 }
 /**
  * Forces the connection to close.
  *
  * Generally there's no need to call it yourself as it will be closed on
  * termination.
  */
 public function close()
 {
     if ($this->isOpen) {
         $this->transport->flush();
         $this->transport->close();
         $this->isOpen = false;
     }
 }
 public function send($buf)
 {
     $this->transport_->write($buf);
     $this->transport_->flush();
 }