public function readLine($token = "\n", $useCR = false)
  {
    $this->connect();

    $line = \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\String::factory("");

    while(!$line->endsWith($token) && !($useCR && $line->endsWith("\r"))) // FUUUUUUU carriage return
    {
      $this->waitForReadyRead();

      $data = @fgets($this->stream, 4096);

      \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\Signal::getInstance()->emit(strtolower($this->getAdapterType()) . "DataRead", $data);

      if($data === FALSE)
      {
        if($line->count())
        {
          $line->append($token);
        }
        else
        {
          throw new Exception("connection to server '" . $this->config["host"] . ":" . $this->config["port"] . "' lost");
        }
      }
      else
      {
        $line->append($data);
      }
    }

    return $line->trim();
  }