org.cybergarage.upnp.ssdp

## Class SSDPSearchSocket

- java.lang.Object
- - org.cybergarage.upnp.ssdp.HTTPMUSocket
  - - org.cybergarage.upnp.ssdp.SSDPSearchSocket

- All Implemented Interfaces:
    Runnable

      public class SSDPSearchSocket
      extends HTTPMUSocket
      implements Runnable

  Socket for sending SSDP search requests and receiving responses.

  This class extends HTTPMUSocket and implements Runnable to provide asynchronous handling of SSDP search operations. It manages both sending M-SEARCH requests and receiving device responses.

  Key features:

  - IPv4 and IPv6 support
  - Multicast search request broadcasting
  - Asynchronous response reception
  - Multi-threaded operation
  - Network interface binding

  This class is used by UPnP control points to perform device discovery by sending M-SEARCH requests to the SSDP multicast address and receiving responses from available devices on the network.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SSDPSearchSocket(InetAddress bindAddr)`
    `SSDPSearchSocket(String bindAddr, int port, String multicast)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSearchListener(SearchListener listener)`
    `boolean` | `open(Inet4Address bindAddr)`
    `boolean` | `open(Inet6Address bindAddr)`
    `boolean` | `open(String bindAddr)`
    `boolean` | `open(String bind, String multicast)`
    `void` | `performSearchListener(SSDPPacket ssdpPacket)`
    `void` | `removeSearchListener(SearchListener listener)`
    `void` | `run()`
    `void` | `start()`
    `void` | `stop()`

    - ### Methods inherited from class org.cybergarage.upnp.ssdp.HTTPMUSocket

      `close, finalize, getLocalAddress, getLocalPort, getMulticastAddress, getMulticastInetAddress, getMulticastPort, getSocket, open, open, post, post, receive, send, send, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### SSDPSearchSocket

          public SSDPSearchSocket(InetAddress bindAddr)
                           throws IOException

      Parameters:
        `bindAddr` - the binding address for sending multicast packet
      Throws:
        `IOException`

    - #### SSDPSearchSocket

          public SSDPSearchSocket(String bindAddr,
                                  int port,
                                  String multicast)
                           throws IOException

      Parameters:
        `bindAddr` - The address to bind the service
        `port` - The port used for accepting message
        `multicast` - The multicast address to use as destination
      Throws:
        `IOException`

  - ### Method Detail

    - #### addSearchListener

          public void addSearchListener(SearchListener listener)

    - #### open

          public boolean open(Inet4Address bindAddr)

    - #### open

          public boolean open(Inet6Address bindAddr)

    - #### open

          public boolean open(String bindAddr)

      Parameters:
        `bindAddr` - the hostname of the interface to use for sending multicast packet
      Returns:
        true if and only if it open the socket
      See Also:
        `for default multicast and port destination of the packets`

    - #### open

          public boolean open(String bind,
                              String multicast)

    - #### performSearchListener

          public void performSearchListener(SSDPPacket ssdpPacket)

    - #### removeSearchListener

          public void removeSearchListener(SearchListener listener)

    - #### run

          public void run()

      Specified by:
        `run` in interface `Runnable`

    - #### start

          public void start()

    - #### stop

          public void stop()