When using SocketChannel, you need to save read and write buffers to handle partial write and read.
I have a suspicious suspicion that this might not be necessary when using the DatagramChannel, but there is little information.
What story?
Do I have to repeatedly (non-block) ByteBuffer until I get zero to read all pending datagrams?
When sending to non-blocking mode, can I rely on send (ByteBuffer, SocketAddress) to either send the entire buffer, or completely reject it, or do I need to save partially written buffers?
Nuoji source
share