In my project i'm checking for the ports availability during server startup. When server is in stop state all ports are showing available(using netstat command-nothing is returning) except the postgres port(5432) on linux. Same port is showing correct status in windows. Following is the netstat output for the 5432 port on linux when the server is not running. I'm wondering can someone please explain what exactly the output mean and why the same it is not showing in windows.
$ netstat -aon | grep "5432"
tcp6 0 0 127.0.0.1:36524 127.0.0.1:5432 TIME_WAIT timewait (24.23/0/0)
tcp6 0 0 127.0.0.1:36518 127.0.0.1:5432 TIME_WAIT timewait (1.85/0/0)
tcp6 0 0 127.0.0.1:36526 127.0.0.1:5432 TIME_WAIT timewait (28.95/0/0)
tcp6 0 0 127.0.0.1:36522 127.0.0.1:5432 TIME_WAIT timewait (21.85/0/0)
tcp6 0 0 127.0.0.1:36523 127.0.0.1:5432 TIME_WAIT timewait (24.18/0/0)
tcp6 0 0 127.0.0.1:36528 127.0.0.1:5432 TIME_WAIT timewait (31.48/0/0)
tcp6 0 0 127.0.0.1:36529 127.0.0.1:5432 TIME_WAIT timewait (31.53/0/0)
tcp6 0 0 127.0.0.1:36527 127.0.0.1:5432 TIME_WAIT timewait (29.00/0/0)
tcp6 0 0 127.0.0.1:36520 127.0.0.1:5432 TIME_WAIT timewait (11.85/0/0)
For all other ports netstat command output is empty when server is not running state. If possible please explain what each column is.
Thanks in advance.