eli5: difference between socket and a port

136 views

After searching both these things up, I got that in networking, both a socket and a port is a commication endpoint. However, in many articles I’ve read they are used in different ways. Can someone explain key differences between a port and a socket, or provide a good analogy for one?

In: 7

4 Answers

Anonymous 0 Comments

If it was a phone line

The port would be the last part of the phone number you want to call

The socket would kinda be the call that your secretary has made for you from her desk. She calls the number you want to call, sets up the call, and then you pick up the phone on your desk and start talking. Here your secretary is the OS that handles the setting up of the connection. And you are the program that needs to use the connection for whatever purpose.

You are viewing 1 out of 4 answers, click here to view all answers.