The netstat(8)
man page states "Show both listening and non-listening (for TCP this means established connections) sockets. With the --interfaces option, show interfaces that are not marked"
What is a non-listening socket vs a listening socket? Does it still occupy the port? or is the port free to be used by other programs?
A listening socket is one where the server process is waiting for someone to connect to it, for example, an idle web server. The port it is listening on is considered in use.
A non-listening socket is one where a connection has been made, for example, a web server where a web client, such as a browser, has connected, and data can be or is being transmitted. The port the socket was listening on is usually then also cycled back to be listened on by the same process or process tree.