My Oracle Support Banner

How to Test If a TCP Port is Free and a Process Can Bind to it (Doc ID 743823.1)

Last updated on APRIL 28, 2023

Applies to:

Enterprise Manager for Fusion Middleware - Version to
Oracle WebLogic Server - Version 10.3.6 to
Oracle Fusion Middleware - Version to [Release AS10gR2 to 12c]
Oracle HTTP Server - Version and later
Oracle Containers for J2EE - Version to [Release AS10gR2 to AS10gR3]
Information in this document applies to any platform.


The purpose of this note is to test if a given TCP port is free and any process can bind to it. This way we can isolate errors like "address already in use" and "Bind failed" without involving any specific Application Server component.

The test is a java class performing a bind to the specified TCP port. It will locked the port for 10 seconds and then releasing it.



To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document
 Sample Output

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.