Join 36000+ teachers and students using TTIO.
A socket is one endpoint of a two-way communication link between two programs running on the network. A socket is bound to a port number so that the TCP layer can identify the application that data is destined to be sent to. An endpoint is a combination of an IP address and a port number
A connection between two computers uses a socket.
A socket is the combination of IP address plus port
Imagine sitting on your PC at home, and you have two browser windows open. One looking at the Google website, and the other at the Yahoo website. The connection to Google would be:
Your PC – IP1+port 60200 ——– Google IP2 +port 80 (standard port) The combination IP1+60200 = the socket on the client computer and IP2 + port 80 = destination socket on the Google server.
The connection to Yahoo would be:
your PC – IP1+port 60401 ——–Yahoo IP3 +port 80 (standard port) The combination IP1+60401 = the socket on the client computer and IP3 + port 80 = destination socket on the Yahoo server.
www.teachyourselfpython.com