| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_SIZE |
protected Sink |
sink |
protected DatagramSocket |
sock |
protected Thread |
thread |
| Constructor and Description |
|---|
UDPSource(DatagramSocket sock)
use socket from UDPSink
|
UDPSource(int port) |
| Modifier and Type | Method and Description |
|---|---|
int |
getPort() |
void |
run() |
void |
setSink(Sink sink)
Sets the sink for received UDP datagrams.
|
void |
start()
Starts the source thread to begin receiving UDP datagrams.
|
void |
stop()
Stops the source thread and closes the socket.
|
public static final int MAX_SIZE
protected Sink sink
protected final DatagramSocket sock
protected final Thread thread
public UDPSource(DatagramSocket sock)
public UDPSource(int port)
RuntimeException - on DatagramSocket IOExceptionpublic int getPort()
public void setSink(Sink sink)
public void start()
public void stop()