[Master Answer Logo]
Question

How can I find what port a process is listening on?

Answer

Processes implement connections to TCP and UDP ports by means of sockets. A socket is a transport end-point, which a process can create and then bind to a socket address; in TCP or UDP, a socket address consists of a combination of a port and an IP number. Sockets may be set to send/receive data in one direction at a time, called half duplex, or simultaneously in both directions, called full duplex. (Aside from TCP and UDP ports, sockets may also be bound to software network ports to connect internal programs on a single computer system.)

— Source: Wikipedia (www.wikipedia.org)