Explain sending UDP Datagrams with the help of an example.

Explain sending UDP Datagrams with the help of an example.

Sending UDP Datagrams – To send data to a particular server, you first must convert the data into byte array. Next you pass this byte array, the length of the data in the array (most of the time this will be the length of the array) the InetAddress and port to DatagramPacket() constructor.

For example, first you create atagramPacket object try

{

Networking Features

InetAddress m = new InetAddress(“http://mail.yahoo.com”); int chargen = 19;

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!