From skimming the source for sun.nio.ch.DatagramChannelImpl.
it looks to me like 'buf' needs to be reassigned in getDirectBuffer()
whenever it allocates a new buffer. Right now, it gets left as null
and then is passed to receive() which then pointlessly allocates
another buffer to actually receive the data.
As far as I can see this is a performance issue but the
code should behave correctly from a user perspective.
it looks to me like 'buf' needs to be reassigned in getDirectBuffer()
whenever it allocates a new buffer. Right now, it gets left as null
and then is passed to receive() which then pointlessly allocates
another buffer to actually receive the data.
As far as I can see this is a performance issue but the
code should behave correctly from a user perspective.