object on the port on which you want to listen.
Pass an empty
object to the
public synchronized void receive(DatagramPacket dp) throws IOException
The calling thread blocks until a datagram is received.
dp is filled
with the data from that datagram.
getAddress() to tell where the
packet came from,
retrieve the data, and
see how many bytes were in the data.
If the received packet was too long for the buffer, it's truncated to the length of the buffer.
Length is reset when packet is received