Check out example codes for "see what ports are in use". It will help you in understanding the concepts better.

Code Example 1

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

Learn ReactJs, React Native from akashmittal.com