by, 01-08-2012 at 01:21 PM (1681 Views)
Sockets provided communication channeled and support inter process communication in Java. For example to communicate between two JVMs, sockets are used. Socket is an end point for communication. There are two types of sockets.
• Connection less sockets
• Connection oriented sockets
UDP protocol is used in the connection less sockets communication. Also they are referred as datagram communication protocol.
Each socket is indentified with following two numbers:
• IP address
There are 3 phases in the lifetime of a socket.
• Open Socket
• Read and Write to Socket
• Close Socket