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 10.1.2.0.1 to 12.1.2.0.0
Oracle WebLogic Server - Version 10.3.6 to 12.1.2.0.0
Oracle Fusion Middleware - Version 10.1.2.0.2 to 12.1.2.0.0 [Release AS10gR2 to 12c]
Oracle HTTP Server - Version 10.1.2.0.1 and later
Oracle Containers for J2EE - Version 10.1.2.0.2 to 10.1.3.5.0 [Release AS10gR2 to AS10gR3]
Information in this document applies to any platform.
 

Goal

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.

 

Solution

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
Goal
Solution
 Requirements
 Instructions
 Sample Output
References

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