public class UDPListener
extends java.lang.Object
implements java.lang.Runnable
Each incoming packet will be handled in a separate thread.
This listener checks for the multicast address (DPWS = 239.255.255.250) and port (DPWS = 3702). If the address and port which should be used match the multicast values, this listener registers itself for multicast datagram packets.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Stops the UDP listener.
|
void |
ensureOpen() |
boolean |
equals(java.lang.Object obj) |
DatagramSocket |
getDatagramSocket()
Returns the datagram socket which is used for incoming datagram packets.
|
NetworkInterface |
getIface() |
IPAddress |
getLocalAddress() |
int |
getLocalPort() |
UDPDatagramHandler |
getUDPDatagramHandler()
Returns the datagram handler for this listener.
|
int |
hashCode() |
boolean |
isClosed()
Indicates whether this listener is running or not.
|
boolean |
open()
Starts the UDP listener.
|
void |
run() |
public void run()
run in interface java.lang.Runnablepublic DatagramSocket getDatagramSocket()
public UDPDatagramHandler getUDPDatagramHandler()
public boolean isClosed()
true if the listener is running and will handle incoming TCP connections, false
otherwise.public boolean open()
true if the listener is started or already running, false otherwise.public void close()
throws java.io.IOException
java.io.IOExceptionpublic void ensureOpen()
throws java.io.IOException
java.io.IOExceptionpublic int getLocalPort()
public IPAddress getLocalAddress()
public NetworkInterface getIface()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object