java.lang.Object
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<SSDPSearchSocket>, Collection<SSDPSearchSocket>, List<SSDPSearchSocket>, RandomAccess, SequencedCollection<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 Summary
FieldsModifier and TypeFieldDescriptionprivate InetAddress[]Local addresses the sockets are opened on, or null to bind all interfaces.private StringIPv4 SSDP multicast group the search requests are sent to.private StringIPv6 SSDP multicast group the search requests are sent to.private intSSDP port the search requests are sent to.Fields inherited from class Vector
capacityIncrement, elementCount, elementDataFields inherited from class AbstractList
modCountConstructor Summary
ConstructorsConstructorDescriptionCreates an empty list.SSDPSearchSocketList(InetAddress[] binds) Constructor with bind addresses.SSDPSearchSocketList(InetAddress[] binds, int port, String multicastIPv4, String multicastIPv6) Create SSDP search socket list.Method Summary
All MethodsModifier and TypeMethodDescriptionvoidaddSearchListener(SearchListener listener) Adds a search listener to all sockets.voidclose()Closes all search sockets.getSSDPSearchSocket(int n) Returns the socket at the given index.booleanopen()Opens all search sockets.voidstart()Starts all search sockets.voidstop()Stops all search sockets.Methods inherited from class Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, removeRange, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSizeMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, reversed
Field Details
binds
Local addresses the sockets are opened on, or null to bind all interfaces.multicastIPv4
IPv4 SSDP multicast group the search requests are sent to.multicastIPv6
IPv6 SSDP multicast group the search requests are sent to.port
private int portSSDP port the search requests are sent to.
Constructor Details
SSDPSearchSocketList
public SSDPSearchSocketList()Creates an empty list.SSDPSearchSocketList
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 toport- the port the search sockets send frommulticastIPv4- IPv4 multicast addressmulticastIPv6- IPv6 multicast address
Method Details
getSSDPSearchSocket
Returns the socket at the given index.- Parameters:
n- the zero-based position in the list- Returns:
- the search socket at that position
addSearchListener
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.