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

public class SSDPSearchResponseSocketListextends Vector<SSDPSearchResponseSocket>
A list of SSDP search response sockets for handling SSDP search responses.
This class manages multiple SSDPSearchResponseSocket instances to send SSDP search requests and receive responses across different network interfaces.
See Also:
  • Field Details

    • binds

      private InetAddress[] binds
      /////////////////////////////////////////////
  • Constructor Details

    • SSDPSearchResponseSocketList

      public SSDPSearchResponseSocketList()
      Creates an empty list of SSDP search response sockets.
    • SSDPSearchResponseSocketList

      public SSDPSearchResponseSocketList(InetAddress[] binds)
      Create a socket list bound to the given addresses.
      Parameters:
      binds - The host to bind.Use null for the default behavior
  • Method Details

    • setControlPoint

      public void setControlPoint(ControlPoint ctrlPoint)
      Sets the control point every socket in the list reports to.
      Parameters:
      ctrlPoint - the control point every socket in the list reports to
    • getSSDPSearchResponseSocket

      public SSDPSearchResponseSocket getSSDPSearchResponseSocket(int n)
      Gets the response socket at a position in the list.
      Parameters:
      n - the zero-based position in the list
      Returns:
      the response socket at that position
    • open

      public boolean open(int port)
      Opens a response socket per bound interface on the given port.
      Parameters:
      port - the port every response socket is opened on
      Returns:
      false if a socket could not be opened, after closing and clearing the list
    • open

      public boolean open()
      Opens a response socket per bound interface on the default port.
      Returns:
      false if a socket could not be opened, after closing and clearing the list
    • close

      public void close()
      Closes every response socket and empties the list.
    • start

      public void start()
      Starts the listener thread of every response socket.
    • stop

      public void stop()
      Stops the listener thread of every response socket.
    • post

      public boolean post(SSDPSearchRequest req)
      Sends an M-SEARCH request from all sockets in the list.
      Parameters:
      req - the search request to broadcast
      Returns:
      true if all sends succeeded