/** * Closes socket */ public function __destruct() { if ($this->socket) { $this->socket->close(); } }