|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--local.net.UdpRelay
UdpRelay implements a direct UDP datagram relay agent. It receives UDP packets at a local port and relays them toward a remote UDP socket (destination address/port).
| Field Summary | |
static int |
MAX_PKT_SIZE
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
UdpRelay(int local_port,
java.lang.String dest_addr,
int dest_port,
int alive_time,
UdpRelayListener listener)
Creates a new UDP relay and starts it. |
|
UdpRelay(int local_port,
java.lang.String dest_addr,
int dest_port,
UdpRelayListener listener)
Creates a new UDP relay and starts it. |
|
| Method Summary | |
int |
getLocalPort()
Gets the local receiver/sender port |
int |
getSoTimeout()
Gets the maximum time that the UDP relay can remain active after been halted |
void |
halt()
Stops the UDP relay |
boolean |
isRunning()
Whether the UDP relay is running |
static void |
main(java.lang.String[] args)
The main method. |
void |
run()
Redirect packets received from remote source addr/port to destination addr/port |
UdpRelay |
setDestAddress(java.lang.String dest_addr)
Sets a new destination address |
UdpRelay |
setDestPort(int dest_port)
Sets a new destination port |
void |
setSoTimeout(int so_to)
Sets the maximum time that the UDP relay can remain active after been halted |
java.lang.String |
toString()
Gets a String representation of the Object |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int MAX_PKT_SIZE
| Constructor Detail |
public UdpRelay(int local_port,
java.lang.String dest_addr,
int dest_port,
UdpRelayListener listener)
The UdpRelay remains active until method halt() is called.
public UdpRelay(int local_port,
java.lang.String dest_addr,
int dest_port,
int alive_time,
UdpRelayListener listener)
The UdpRelay will automatically stop after alive_time seconds of idle time (i.e. without receiving UDP datagrams)
| Method Detail |
public int getLocalPort()
public UdpRelay setDestAddress(java.lang.String dest_addr)
public UdpRelay setDestPort(int dest_port)
public boolean isRunning()
public void halt()
public void setSoTimeout(int so_to)
public int getSoTimeout()
public void run()
run in class java.lang.Threadpublic java.lang.String toString()
toString in class java.lang.Threadpublic static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||