public class SSDPSearchSocket extends HTTPMUSocket implements Runnable
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:
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 and Description |
|---|
SSDPSearchSocket(InetAddress bindAddr) |
SSDPSearchSocket(String bindAddr,
int port,
String multicast) |
| 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() |
close, finalize, getLocalAddress, getLocalPort, getMulticastAddress, getMulticastInetAddress, getMulticastPort, getSocket, open, open, post, post, receive, send, send, toStringpublic SSDPSearchSocket(InetAddress bindAddr) throws IOException
bindAddr - the binding address for sending multicast packetIOExceptionpublic SSDPSearchSocket(String bindAddr, int port, String multicast) throws IOException
bindAddr - The address to bind the serviceport - The port used for accepting messagemulticast - The multicast address to use as destinationIOExceptionpublic void addSearchListener(SearchListener listener)
public boolean open(Inet4Address bindAddr)
public boolean open(Inet6Address bindAddr)
public boolean open(String bindAddr)
bindAddr - the hostname of the interface to use for sending multicast packetfor default multicast and port destination of the packetspublic void performSearchListener(SSDPPacket ssdpPacket)
public void removeSearchListener(SearchListener listener)
public void start()
public void stop()