write($data); } $this->close(); } public function isWritable() { return !$this->closed; } public function close() { if ($this->closed) { return; } $this->closed = true; $this->emit('end', array($this)); $this->emit('close', array($this)); $this->removeAllListeners(); } }