Is there any way for me to check for a port setting before assigning it?

Of course when another application is using the port, and I want to use the same port, of course there would be conflict.

Is there anyway for me to be able to check the port avaiability before the system decides to use it?

*thank you*