| Modifier and Type | Field and Description |
|---|---|
protected InetAddress |
remoteHost |
protected int |
remotePort |
protected DatagramSocket |
sock |
| Constructor and Description |
|---|
UDPSink(DatagramSocket socket,
InetAddress host,
int port) |
UDPSink(InetAddress host,
int port) |
| Modifier and Type | Method and Description |
|---|---|
int |
getPort() |
DatagramSocket |
getSocket()
Returns the underlying DatagramSocket for use by UDPSource constructor.
|
void |
send(Destination src,
int fromPort,
int toPort,
byte[] data) |
void |
stop()
Closes the underlying DatagramSocket.
|
protected final InetAddress remoteHost
protected final int remotePort
protected final DatagramSocket sock
public UDPSink(DatagramSocket socket, InetAddress host, int port)
socket - existing sockethost - where to sendport - where to sendpublic UDPSink(InetAddress host, int port)
host - where to sendport - where to sendIllegalArgumentException - on DatagramSocket IOExceptionpublic int getPort()
public DatagramSocket getSocket()
public void send(Destination src, int fromPort, int toPort, byte[] data)
send in interface Sinksrc - ignoredfromPort - ignoredtoPort - ignoredRuntimeException - on DatagramSocket IOExceptionpublic void stop()