All Implemented Interfaces:
Serializable, Cloneable, Iterable<SSDPSearchSocket>, Collection<SSDPSearchSocket>, List<SSDPSearchSocket>, RandomAccess, SequencedCollection<SSDPSearchSocket>

public class SSDPSearchSocketListextends Vector<SSDPSearchSocket>
A collection of SSDP search sockets.

This class extends Vector to manage multiple SSDPSearchSocket objects that handle outgoing SSDP search requests. It provides type-safe management of the socket pool used for device discovery operations.

Key features:

  • Multi-socket management for search requests
  • Control request broadcasting to all sockets
  • Network interface support
  • Socket lifecycle management
  • Efficient search request distribution

This class is used by UPnP control points to manage multiple sockets for sending SSDP M-SEARCH requests across different network interfaces, enabling comprehensive device discovery in multi-homed environments.

See Also:
  • Field Details

    • binds

      private InetAddress[] binds
      Local addresses the sockets are opened on, or null to bind all interfaces.
    • multicastIPv4

      private String multicastIPv4
      IPv4 SSDP multicast group the search requests are sent to.
    • multicastIPv6

      private String multicastIPv6
      IPv6 SSDP multicast group the search requests are sent to.
    • port

      private int port
      SSDP port the search requests are sent to.
  • Constructor Details

    • SSDPSearchSocketList

      public SSDPSearchSocketList()
      Creates an empty list.
    • SSDPSearchSocketList

      public SSDPSearchSocketList(InetAddress[] binds)
      Constructor with bind addresses.
      Parameters:
      binds - the local addresses the sockets are opened on
    • SSDPSearchSocketList

      public SSDPSearchSocketList(InetAddress[] binds, int port, String multicastIPv4, String multicastIPv6)
      Create SSDP search socket list.
      Parameters:
      binds - the local addresses each search socket binds to
      port - the port the search sockets send from
      multicastIPv4 - IPv4 multicast address
      multicastIPv6 - IPv6 multicast address
  • Method Details

    • getSSDPSearchSocket

      public SSDPSearchSocket getSSDPSearchSocket(int n)
      Returns the socket at the given index.
      Parameters:
      n - the zero-based position in the list
      Returns:
      the search socket at that position
    • addSearchListener

      public void addSearchListener(SearchListener listener)
      Adds a search listener to all sockets.
      Parameters:
      listener - the listener to register on every socket in the list
    • open

      public boolean open()
      Opens all search sockets.
      Returns:
      true always, even when every bind fails and no socket is opened
    • close

      public void close()
      Closes all search sockets.
    • start

      public void start()
      Starts all search sockets.
    • stop

      public void stop()
      Stops all search sockets.