It occurs to me that I don't know how to formally define "port" in any context in which I know the word.
-
-
Are you genuinely asking for a technical definition of 'port' in the TCP/UDP/IP context? Or is it rhetorical? Because the last time I offered a reply to a woman on the subject 50 people jumped on me for 'mansplaining' despite it being asked, and being an expert on the subject
-
I am genuinely curious as to what the mapping is between the integer value and the whatever under the hood.
-
Nothing too magical about it. Any program can listen on any port it wants. Some ports are standardized, but doesn't stop a program from listening on those ports anyway. Like web browsers always use 80 (and redirected to 443 if https is required).
-
After that, it can be as simple as just a chat client passing plain text back and forth.
-
No I know but how do the integers map? Is it a hashmap implementation, what do they do under the hood when you specify e.g. port 8888
-
Hmm. Not sure what you mean exactly then, my apologies. It's not exactly mapping, you just tell your program what port to listen on. If you tell it to listen on 80 and point a web browser to localhost, your web browser will then be talking with your program.
-
Yes I know that but what does the 80 *do* that 79 *doesn’t*
-
Absolutely nothing :) That's the beauty. Ever use a web browser to connect to your home router on port 8080? Functionally identical to Port 80, they just use 8080 so as not to conflict with anything listening on 80
- 6 more replies
New conversation -
-
-
I've done way too many TCP/UDP things at that level (came to regret a few), and I still don't know how I'd define it. Not least because I can't think of a reason to place a concept of "port" between the concepts of "port number" and "socket".
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
A designated point of ingress or egress.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.