public function __construct(Download $download, $url) { parent::__construct($download, $url); if (!preg_match('#^udp://([^\\:]+)\\:(\\d+)#', $url, $match)) { $this->error = "Cannot parse URL"; return; } $this->ip = gethostbyname($match[1]); if (!Util::isIPv4($this->ip)) { $this->error = "Unable to resolve IP for '{$url}'"; return; } $this->port = (int) $match[2]; if ($this->port <= 0) { $this->error = "Unable to parse UDP port"; return; } $this->transID = rand(); $this->connectionID = null; }
public function __construct() { parent::__construct(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); }
public function __construct(Download $download, $url) { parent::__construct($download, $url); }