5 ms·
I am surprised to see so much comments without mentioning the reason of that (written in the thread)... * It's the new AirPlay server capability. * It can be
by rock_artist 5y ago
I am surprised to see so much comments without mentioning the reason of that (written in the thread)...
* It's the new AirPlay server capability.
* It can be toggled off.
* Those ports are the defaults for AirPlay.
It might've been nice to allow simple way of customizing the ports though..
- deleted 5y ago[deleted]
- zinekeller 5y agoSidenote: a dispute (https://news.ycombinator.com/item?id=29305298 https://news.ycombinator.com/item?id=29305298) has been raised on the validity of UPnP even properly using the port. All the details here not contradicting are still correct to the best of my knowledge and research. Update: "It would appear commplex was a part of seeplex, some visualization tool for old Sun workstations in the early 90ies https://lib.dr.iastate.edu/cgi/viewcontent.cgi?article=11617&context=rtd https://lib.dr.iastate.edu/cgi/viewcontent.cgi?article=11617..." "The Commplex is a communications package for communication with the NCUBE from Sun workstations." > * Those ports are the defaults for AirPlay. No, those are the default port for UPnP discovery, and have been used also by Microsoft in the XP days. There's a reason Apple picked them: it's aligned with their use case, and already assigned by what, 16 years or so? Probably also the context that you're missing, since that this post is actually somewhat a dupe.
- the_mitsuhiko 5y agoUPnP does not own this port. In the past that also hasn't been much of a problem as the port 5000 was opened by UPnP on the Router, not on localhost where Flask or other web servers are normally listening.
- marcellus23 5y agoSoftware should be written under the assumption that any given port can already be in use.
- TomSwirly 5y agoMost software has zero need for this. My company's product contains a web server. We don't bother to check to see if some other program is using port 80 or 443, we just use it. The reason is that we own the machine, we install the software, and we know there is nothing running on these ports; and more, if something is on these ports, we have no way to recover, so terminating abnormally is the right answer.
- the_mitsuhiko 5y agoI'm not aware of any software that is not written that way.
- tsimionescu 5y agoWell, apparently Flask or other web dev environments fail to start if their default port is already in use...
- tristor 5y agoThat's a misunderstanding of sockets and ports. A port alone is not sufficient for anything, to send traffic across an IP network you need a socket, a socket is tuple of a port and an IP address. When a SERVER "binds" a port, what it's doing is opening a socket for listening against the address specified for binding (generally 0.0.0.0 known as INADDR_ANY). Sockets cannot collide, therefore you cannot bind more than one service running on a host to the same socket, which means if both are using INADDR_ANY, they cannot use the same port. Nothing prevents you from having multiple IPs on a host, each bound by IP to the same port (which would be separate sockets). For CLIENT applications, they aren't just utilizing sockets, they're utilizing connections, and a connection is a tuple of two sockets. You can have many many many connections utilizing the same port, as long as they don't collide exactly with the socket on the other side in their signature. There are various ways to handle this, but a typical one is that servers do a hand-off during connection initialization to a temporary port assigned to that connection. So, Flask (a server), is saying you can't bind it to listen on a socket which is previously bound because it would cause a collision and violate the no-collision rule for sockets. But it doesn't in any way mean that port can't be overloaded by different sockets being bound to the same port.
- p49k 5y agoNeither does Flask and similar, and they are the ones who arbitrarily picked an already-registered port and didn’t bother registering their own.
- the_mitsuhiko 5y agoThe port registration system effectively broke down somewhere in the 90ies. There are just too many software projects that need ports in a very limited space. The software we're discussing here (AirPlay apparently) also did not register this port.