|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.ow2.clif.probe.rtp.RTPListener
public class RTPListener
Thread to open and listen UDP packets.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary | |
---|---|
void |
close()
Close the listener and the sockets by stopping thread. |
static RTPListener |
getInstance()
Create or get the single instance of the thread |
java.util.LinkedList<RTPInformation> |
getPackets(java.lang.Integer timeout)
This method return list of packets before cleaning it. |
void |
openSocket(java.net.InetAddress addr,
java.util.ArrayList<java.lang.Integer> ports)
Open sockets using java.nio |
void |
run()
|
void |
sendPacket(byte[] data,
java.net.InetAddress remoteAddress,
int remotePort,
int localPort)
Send a RTP packet on the given local port to the remote client. |
void |
startListener()
Start the thread of the singleton if it hasn't been started yet. |
Methods inherited from class java.lang.Thread |
---|
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 |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static RTPListener getInstance()
public void openSocket(java.net.InetAddress addr, java.util.ArrayList<java.lang.Integer> ports)
addr
- : the address to open socket (can be null)ports
- : the ports to openpublic void startListener()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
This method listen to the ports opened previously with openSocket.
The size of RTP/RTCP packets must be less than 512 bytes.
public java.util.LinkedList<RTPInformation> getPackets(java.lang.Integer timeout)
public void sendPacket(byte[] data, java.net.InetAddress remoteAddress, int remotePort, int localPort)
data
- : the packet.remoteAddress
- : InetAddress of the remote client.remotePort
- : the port of the remote client.localPort
- : the port on which the packet is sent.public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |