My code currently works when I use it but I think I’m making some assumptions that may not hold true under heady load.
I have a bunch of java.nio.channels.DatagramChannel’s which I’ve setup so I can send/receive UDP packets. I then register them with a Selector and wait for input. That so far seems to work.
My potential problem is with the channel.read(ByteBuffer) method. If two packets have been received on a channel before I can read them will the next read(ByteBuffer) operation read them both or will I need to read the channel twice? Personally I’m hoping for the latter but increasingly I’m feelling like the former is the actuall behavior.