Do I need to create a new DatagramPacket object for each datagram I send?

Tim Rohaly

No. You should reuse your DatagramPackets. Object creation is an expensive operation. If you are going to be sending many packets, it is much more efficient to simply reset the contents of the packet using the setData method.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact