Check out example codes for "how to check for open ports in windows". It will help you in understanding the concepts better.

Code Example 1

netstat -an

Learn ReactJs, React Native from akashmittal.com