public class SSDPSearchRequestextends SSDPRequest
Represents an SSDP M-SEARCH request for device discovery.

This class extends SSDPRequest to handle M-SEARCH messages used by UPnP control points to discover devices and services on the network. It manages the creation and configuration of search requests with specific targets and timing parameters.

Key features:

  • M-SEARCH method and URI configuration
  • Search target (ST) specification
  • MX (Maximum wait time) parameter management
  • Multicast destination configuration
  • MAN header specification

This class is used by UPnP control points to initiate device discovery searches, allowing them to find devices matching specific search targets such as device types, service types, or unique device identifiers.

  • Constructor Details

    • SSDPSearchRequest

      public SSDPSearchRequest(String serachTarget, int mx)
      Build an M-SEARCH announcing the given search target and wait time.
      Parameters:
      serachTarget - the search target to advertise in the ST header, e.g. a device type
      mx - the MX maximum wait time in seconds advertised to the responders
    • SSDPSearchRequest

      public SSDPSearchRequest(String serachTarget)
      Build an M-SEARCH for the given search target at the default wait time.
      Parameters:
      serachTarget - the search target to advertise, using the default MX wait time
    • SSDPSearchRequest

      public SSDPSearchRequest()
      Build an M-SEARCH for the root device, the usual first discovery step.
  • Method Details

    • setLocalAddress

      public void setLocalAddress(String bindAddr)
      Aim the search at the SSDP multicast group, v4 or v6 by bind address.
      Parameters:
      bindAddr - the local address to bind to; an IPv6 address selects the IPv6 group