In this section we provide a complete code of a example based on the method DatagramPacket(buffer, buffer.length) for constructs a DatagramPacket for receiving packets of length length in more generic way. First of all create a class UDPReceiver and initialize a object buffer of byte array. After that we call the DatagramPacket(buffer, buffer.length) method for creating a datagram packet to receive data.
Here is the code of this example:
Here is the Output of the Example :
Datagram packet receive.
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: June 16, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles