Frage

I am using netstat to display the open port, but I am wondering when a port is opened is it only when a bind() is invoked in a process, or it is already available and the bind just change its state to listen.

Keine korrekte Lösung

Andere Tipps

There is a maximum number of ports in a system (depends on the OS, but in general it's 65535 or (2^16)-1), there are privileged ports (<1024) and there are non-privileged ports (>1024). Privileged ports require root permissions to use them, non-privileged allow user processes to bind. But port is considered open or used at the point when you call bind(). You can read up on sockets in general at this location.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top