I am building a networked application using DatagramSocket
.
I have a "network" thread whose sole job is to pull DatagramPacket
objects from a DatagramSocket
and place the data on a BlockingQueue
. It does this as fast as it is able. The queue is then consumed by other threads.
Suppose my "network" thread is running slow and packets are building up at the socket.
- Is it possible for the socket to "overflow" and packets get lost?
- Is there any advantage to taking packets from the socket and storing them in a POJO queue early?
- Is my "network" thread and queue setup really necessary - should I just work with
DatagramSocket
directly?