Viewing a single comment thread. View all comments

DragonFireCK t1_j20a7hk wrote

>Why can’t port numbers below 49152 act like “Airbnb for applications?” Conversely, why can’t port 49153 and above have, per your analogy, “long-term tenants.” Or can they?

Convention - the same as why a hotel room generally won't have a long-term occupant and an apartment won't have a short-term renter. With that, its also likely somebody else may be using them for their intended purpose, thus causing random failures if an application tries to use them incorrectly.

Firewalls will also frequently block or allow specific ports by number, though they will normally only block incoming connections, not outgoing. This may cause a program using an unexpected port to get incorrectly blocked, requiring users to manually open those ports.

>Furthermore, what event on the server would be equivalent to “evicting” a program from its “apartment?”

Generally, the operating system will have a method of force disconnecting a socket, though such APIs are normally tightly restricted in usage. In most cases, they are restricted to usage by debugging tools.

2

interwebz_2021 t1_j210clo wrote

>socket

Just in case anyone's not seen the term 'socket' before: this is a logical address comprised of the IP address and port. So, for instance, if you have a web server listening on port 80 on your local loopback interface with IP address 127.0.0.1, you can connect to the webserver via the socket with address 127.0.0.1:80

3