php-upnp/src/HTTPU/MSearchRequest.php

29 lines
569 B
PHP

<?php
namespace NoccyLabs\UPnP\HTTPU;
class MSearchRequest extends Request
{
protected $max_wait = 0;
public function __construct($host='239.255.255.250', $port='1900')
{
parent::__construct('M-SEARCH * HTTP/1.1', $host, $port);
$this->headers['Man'] = '"ssdp:discover"';
$this->headers['MX'] = max(0,$this->max_wait);
}
public function setMaxWait($seconds)
{
$this->max_wait = $seconds;
}
public function setSearchType($search_type)
{
$this->headers['ST'] = $search_type;
}
}