be.lassi.lanbox.udp
Class UdpReceiver
java.lang.Object
be.lassi.lanbox.udp.UdpReceiver
public class UdpReceiver
- extends java.lang.Object
Receives and processes incoming UDP packets from the lanbox.
Method Summary |
void |
close()
Closes the receiver network connection. |
UdpPacket |
nextPacket()
Reads a new packet from the UDP receive socket. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UdpReceiver
public UdpReceiver(ConnectionPreferences properties)
- Constructs a new receiver.
- Parameters:
properties
- connection configuration information
close
public void close()
- Closes the receiver network connection.
nextPacket
public UdpPacket nextPacket()
- Reads a new packet from the UDP receive socket. This method gets called
right after the previous update of the user interface for the previous
packet was finished. We do not need to return a new packet immediately
but we can drop all packets that arrive before the wait time is finished.
- Returns:
- the new packet or null when no packet is received
within the timeout period