Use nc to check whether a specific port of IP is open for connection
Usage of nc detection port
Nc-z-w 10% IP% PORT%
-z means to detect or scan the port
-w indicates timeout
-u means to use the UDP protocol
For example:
Nc-z-w 5 10.16.10.52 9901
Try to connect to port 9901 of 10.16.10.52 with a timeout bit of 5 seconds.