Kraken\Ipc\Zmq\ZmqBuffer::end PHP Method

end() public method

Close buffer.
public end ( )
    public function end()
    {
        $this->closed = true;
        if (!$this->listening) {
            $this->emit('end');
        }
    }

Usage Example

Beispiel #1
0
 /**
  * Deactivate socket, wait to complete sending all unfinished data, then close connection.
  */
 public function end()
 {
     if ($this->closed) {
         return;
     }
     $that = $this;
     $this->buffer->on('end', function () use($that) {
         $that->close();
     });
     $this->buffer->end();
 }