Standard/TeamSpeak/TeamSpeak3/Transport/TCP.php
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();
  }
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();
  }
Reads a single line of data from the stream.

@param  string $token
@throws Exception
@return \ManiaLivePlugins\Standard\TeamSpeak\TeamSpeak3\Helper\String