Professional Documents
Culture Documents
I. Practical Significance:
Java provides the socket programming approach for communication between the
client and server. A user can write the code for both client and server as well for UDP
& TCP datagram packets. By using java’s network communication feature we can
create interactive application to communicate within a network.
The java.net.Socket class is used to communicate between client and server.The client
can obtain object by creating its instance whereas the server obtains a Socket object
from the return value of the accept() method.
Nil
Sr.
Name of Resource Broad Specification Quantity Remarks (If any)
No.
1
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
1. …………………………………..
2. …………………………………..
3. …………………………………..
Dated signature
Marks Obtained
of Teacher
Process Product
Total(50)
Related(35) Related(15)
I. Practical Significance:
The User Datagram Protocol (UDP) is connectionless, and unreliable protocol by
which the user can send short messages called datagrams. The java provides
DatagramSocket and DatagramPacket class to implement the concept of user
datagram protocol. By using these classes we can transfer the data asynchronous
manner.
The Java DatagramSocket class is used to send and receive the datagrams it is
connection less socket. That is there is no guarantee of message delivery.
It has following constructors
1. DatagramSocket()
2. DatagramSocket(int port)
3. DatagramSocket(int port, InetAddress address)
Nil
Sr. Name of
Broad Specification Quantity Remarks (If any)
No. Resource
1
import java.net.*;
public class DGramSender
{
public static void main(String[] args) throws Exception
{
DatagramSocket ds = new DatagramSocket();
String str = "Java is Easy!!!!!";
InetAddress ip = InetAddress.getByName("127.0.0.1");
DatagramPacket dp = new DatagramPacket(str.getBytes(), str.length(),
ip, 3000);
ds.send(dp);
ds.close();
}
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
.......................................................................................................................................................
1. …………………………………..
2. …………………………………..
3. …………………………………..
Dated signature
Marks Obtained
of Teacher
Process
Product Related(15) Total(50)
Related(35)