public class UdpPacketReceiver extends java.lang.Thread implements IPacketReceiver
Constructor and Description |
---|
UdpPacketReceiver(java.net.DatagramSocket socket)
Instantiates a new udp packet receiver.
|
UdpPacketReceiver(int port)
Instantiates a new udp packet receiver.
|
Modifier and Type | Method and Description |
---|---|
void |
registerForIncomingPackets(IIncomingPacketObserver observer)
Register for incoming packets.
|
void |
run() |
void |
terminate()
Terminates the operation of this instance.
|
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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
start
public UdpPacketReceiver(java.net.DatagramSocket socket)
socket
- the socketpublic UdpPacketReceiver(int port)
port
- the portpublic void registerForIncomingPackets(IIncomingPacketObserver observer)
IPacketReceiver
registerForIncomingPackets
in interface IPacketReceiver
observer
- the observerpublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void terminate()
ILaunchable
terminate
in interface ILaunchable