public function disconnect()
    {
        if ($this->socket !== NULL) {
            @fclose($this->socket);
        }

        $this->socket = NULL;
        $this->indexes = array();
        $this->currentIndex = 1;
    }