Netstat
From Resin 3.0
The netstat utility is useful for obtaining information from the
operating system about the current state of network usage.
unix$ netstat -anp win> netstat -an
The -a indicates that both listening (waiting for a connection) and non-listening (active) sockets should be displayed. The -n causes the display of port numbers (i.e. 80) instead of port names (i.e. http). The -p causes the display of the process that is using the socket. Since the windows netstat is different than the Unix one, -p is not used on Windows.
Connection state
The connection state is probably the most important information. The man page for netstat has a full description of each state that is displayed.
"LISTEN" or "LISTENING" is an indication that there is a process waiting for connections on the socket.
"TIME_WAIT" indicates that the socket is waiting after close to handle packets still in the network. After a connection is closed, the socket is kept open by the operating system for a short period of time. Even after the close is done, there may be some stray packets on the network that are destined for the connection. The idea of TIME_WAIT is that it keeps the socket open long enough to catch those stray packets, so that they don't get erronously delivered to a new connection opened on the same socket.
Port usage
If Resin is indicating that it cannot bind to a port, it may be an indication that another process is using the port. netstat may help determine the process that is using the port.
Since netstat produces a lot of information, it is helpful to filter the output to limit it to the port of interest. The following example is for port 80:
unix$ netstat -anp | grep ":80" | less