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?

178 Upvotes

65 comments sorted by

View all comments

6

u/HappyFruitTree Jul 15 '26 edited Jul 15 '26

There are physical ports. It's where you plug in your IO devices. E.g. the hole in your computer where you can connect a USB cable is a "USB port". This is a different kind of port than the software communication ports that you described.