Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

UDP: Dynamic DatagramPacket buffer sizes

843790Mar 31 2007 — edited Apr 1 2007
From what I've read of the DatagramSocket documentation, the only way to receive a DatagramPacket is to initialize the packet (and its buffer) ahead of time, and then pass it as an argument to DatagramSocket.receive(DatagramPacket).

I'm wondering why there is no option to dynamically create the DatagramPacket buffer based on the length specified in the header of the incoming packet? Since the packet length is at a well-known location it seems to me that this should be feasible (if a little less efficient).

Thanks,
JR
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2007
Added on Mar 31 2007
1 comment
459 views