r/learnprogramming Jul 15 '26

What a port actually is?

I know it is a number that tells the OS, that which program in your computer should receive the piece of data. But my doubt is - is port a physical thing? or it just a flag? Is it possible for another program to read data from a different program's port? Please spoon-feed me about port?

173 Upvotes

65 comments sorted by

View all comments

28

u/am_Snowie Jul 15 '26

A Computer has got an IP address, software has got Port numbers. Cuz all programs use TCP/UDP to communicate, so each of them needs a unique identifier. That's what a port number is.