public class UdpMultiRelay
extends java.lang.Thread
It can operate according to two relay rules:
Moreover, it can operate according to two filtering rules:
Constructor and Description |
---|
UdpMultiRelay(UdpConnectedSocket socket,
java.util.Vector dest_sockets,
boolean one2one,
boolean filtered,
UdpMultiRelayListener listener)
Creates a new UDP relay and starts it.
|
Modifier and Type | Method and Description |
---|---|
java.util.Vector |
getDestSockets()
Gets the destination sockets where packets have to be sent to.
|
UdpConnectedSocket |
getSocket()
Gets the recv socket
|
int |
getSoTimeout()
Gets the maximum time that the UDP relay can remain active after been halted
|
void |
halt()
Stops the UDP relay
|
boolean |
isFiltered()
Whether source filtering is used
|
boolean |
isOneToOne()
Whether one-to-one rule is used
|
void |
run()
Redirect packets from source addr/port to destination addr/port
|
void |
setFiltered(boolean filtered)
Sets source filtering
|
void |
setOneToOne(boolean one2one)
Sets one-to-one rule
|
void |
setSoTimeout(int so_to)
Sets the maximum time that the UDP relay can remain active after been halted
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public UdpMultiRelay(UdpConnectedSocket socket, java.util.Vector dest_sockets, boolean one2one, boolean filtered, UdpMultiRelayListener listener)
socket
- local socket where packet arrives (and where are sent from, in case of per-destination outgoing socket)dest_sockets
- destination addresses (Vector of UdpConnectedSocket
), where packets have to be sent toone2one
- whether sending all packets to a remote node using the same socket where the remote node sends its packet to (per-destinaiotn outgoing socket)filtered
- whether filtering packet directed to local socket's remote addresslistener
- listener of UdpMultiRelay eventspublic UdpConnectedSocket getSocket()
public java.util.Vector getDestSockets()
UdpConnectedSocket
containing all destination socketspublic boolean isOneToOne()
public void setOneToOne(boolean one2one)
public boolean isFiltered()
public void setFiltered(boolean filtered)
public void halt()
public void setSoTimeout(int so_to)
public int getSoTimeout()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread