Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
System Administration
Showing results for 
Search instead for 
Did you mean: 

How do we free a port number

Go to solution
Kumar Sumit
Occasional Contributor

How do we free a port number

We are running a banking application and there are backend services that run at a particular port number ie poll for a data.

These port numbers are contacted by the front end services which sends messages at these port numbers.

To restart these services the port has to be free.There is an issue today.
There are established connections to the ports numbers and we are unable to start the services.

We are on HPUX superdomes HP-UX dcfngm01 B.11.11 U 9000/800 309255211 unlimited-user license

can you let us know what needs to be done to free a connection at a port.

Sridhar Bhaskarla
Honored Contributor

Re: How do we free a port number


In order to free the port, you will need to stop the process that is responsible for spawning that port.

'lsof' can help you in that aspect. If you know specific ports, you can find the information using

lsof -i tcp:
lsof -i udp:

Will give you information for only those ports.

You can get lsof from the following site.

Do not use any 'ndd' unsupported commands to disconnect the ports unless you know exactly what you are doing. So, I am not going to mention them here.

You may be disappointed if you fail, but you are doomed if you don't try
R. Sri Ram Kishore_1
Respected Contributor

Re: How do we free a port number


Take a look at this thread:


Sri Ram
"What goes up must come down. Ask any system administrator."
rick jones
Honored Contributor

Re: How do we free a port number

A server that cannot bind to its well-known port upon restart, likely as not has a bug where it is _not_ setting SO_REUSEADDR on the socket before it calls bind().
there is no rest for the wicked yet the virtuous have no pillows