Socket is the basically defined as :
- A socket is a mainly use for the transmission of data b/w two hosts It is reliable connection for the transmission.
- Sockets isolate programmers from the details of packet encoding, lost and retransmitted packets, and packets that arrive out of order.
- There are limits. Sockets are more likely to throw IOExceptions than files.