Check out example codes for "cmd listening ports". It will help you in understanding the concepts better.

Code Example 1

Get-Process -Id (Get-NetTCPConnection -LocalPort portNumber).OwningProcess

Code Example 2

netstat -aon

Code Example 3

C:\> netstat -a -b

Code Example 4

Get-Process -Id (Get-NetTCPConnection -LocalPort YourPortNumberHere).OwningProcess

Learn ReactJs, React Native from akashmittal.com