What is the meaning of port 0 in netstat -an output in Windows? I'm asking about socket in Foreign address column:
I know that 0.0.0.0 address means, that host is listening on all interfaces, but what is the function of port zero?
If you see this as the "Foreign" address, the meaning is slightly different – it's not about the interface; that would be the "Local" address.
All zeros in the "Foreign" column just mean that there is no remote address yet. The line represents a listening socket, which will accept connections from any address, any port. Those connections would be displayed as separate lines.
(From what I remember, in some early systems it used to be possible to create TCP sockets that would only accept connections from a specific host, a specific port, or both.)