Transcript of "Socket programming using java"

2.
What started it all.. Internet has emerged as a global ubiquitous media for communication It has changed the way we live, learn, enjoy, communicate, interact, engage, etc. To take advantage of this, businesses are ceaselessly trying to offer their services through the internet. So a huge demand for software developers good in creating internet-enabled applications.

3.
Client Server Applications The Web Service is provided by the server and the clients use these services Client Server NetworkClient machine Server machine A client, where sockets and network This is A server, come in !!

4.
Sockets Introduced in BSD 4.1 UNIX 1981. Sockets are the endpoints of any communication over the internet. Sockets are identified by socket addresses. Socket Address = IP Address + Port Number

5.
Why IP Address + Port number? • IP Address is of the form 10.0.0.1 • Port Number can be anything from 0 to 65,535.

14.
Socket Programming with TCP Server starts first..  Server Process must be running first  Server must have created a socket which welcomes client’s connection. (Welcoming socket) Client contacts server by..  Creating Client local TCP socket  Specify IP Address and port number of server process.  When Client socket is created, the connection is established.  When connection is established, server creates a new socket (Connection Socket) to communicate with that client and the Welcoming socket is once again waiting for connections for other clients.

17.
Types of Sockets in TCP ServerSocket – the socket used by servers Socket – Socket used by clients Create a ServerSocket in the server and make it to wait for connections from Sockets from other clients

19.
Socket Programming with UDP No Connection between client and server.  No handshaking  The sender has to explicitly mention the IP address and the port of the destination.  The server should extract the IP Address of the datagram everytime. Uses DatagramSocket.