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.

没有正确的解决方案

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top