request = $request_line; $this->host = $host; $this->port = $port; } public function getAddress() { return $this->host; } public function getPort() { return $this->port; } public function getBuffer() { $this->headers['Host'] = sprintf("%s:%d", $this->host, $this->port); $buffer = $this->request . "\r\n"; foreach ($this->headers as $key=>$value) { $buffer.= sprintf("%s: %s\r\n", $key, $value); } $buffer.= "\r\n"; return $buffer; } public function setUserAgent($os, $os_version, $product, $product_version) { $this->headers['User-Agent'] = sprintf("%s/%s UPnP/1.1 %s/%s", $os, $os_version, $product, $product_version ); } }