java.lang.Object
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<SSDPSearchResponseSocket>, Collection<SSDPSearchResponseSocket>, List<SSDPSearchResponseSocket>, RandomAccess, SequencedCollection<SSDPSearchResponseSocket>
A list of SSDP search response sockets for handling SSDP search responses.
This class manages multiple
This class manages multiple
SSDPSearchResponseSocket instances to send SSDP search requests and receive responses across different network interfaces.- See Also:
Field Summary
FieldsFields inherited from class Vector
capacityIncrement, elementCount, elementDataFields inherited from class AbstractList
modCountConstructor Summary
ConstructorsConstructorDescriptionCreates an empty list of SSDP search response sockets.SSDPSearchResponseSocketList(InetAddress[] binds) Create a socket list bound to the given addresses.Method Summary
All MethodsModifier and TypeMethodDescriptionvoidclose()Closes every response socket and empties the list.getSSDPSearchResponseSocket(int n) Gets the response socket at a position in the list.booleanopen()Opens a response socket per bound interface on the default port.booleanopen(int port) Opens a response socket per bound interface on the given port.booleanpost(SSDPSearchRequest req) Sends an M-SEARCH request from all sockets in the list.voidsetControlPoint(ControlPoint ctrlPoint) Sets the control point every socket in the list reports to.voidstart()Starts the listener thread of every response socket.voidstop()Stops the listener thread of every response socket.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
/////////////////////////////////////////////
Constructor Details
SSDPSearchResponseSocketList
public SSDPSearchResponseSocketList()Creates an empty list of SSDP search response sockets.SSDPSearchResponseSocketList
Create a socket list bound to the given addresses.- Parameters:
binds- The host to bind.Usenullfor the default behavior
Method Details
setControlPoint
Sets the control point every socket in the list reports to.- Parameters:
ctrlPoint- the control point every socket in the list reports to
getSSDPSearchResponseSocket
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
Sends an M-SEARCH request from all sockets in the list.- Parameters:
req- the search request to broadcast- Returns:
- true if all sends succeeded