- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How can i close open ports.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2004 06:13 AM
тАО09-12-2004 06:13 AM
Our application will open some ports and start some communication. My problem is the application is crashing frequently. If I start the application again.It is giving Following
The ports are already being used.
Choose other free ports.
How can I release the ports before starting the application.?
The application will start if I start after timeout period of the port.
Thanks & Regards
Shashi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2004 06:48 AM
тАО09-12-2004 06:48 AM
SolutionI would check if the processes that are using those ports are actually dying. Use 'lsof' to find that information. For ex.,
lsof -i tcp:2500 will show all the processes that are using the tcp port 2500. Killing those processes as your application is already down should release the ports.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2004 06:55 AM
тАО09-12-2004 06:55 AM
Re: How can i close open ports.
If the ports in question are TCP ports, and if the lsof output shows that no running process is using the port but the port remains used, you can use ndd to forcibly shut down the connections holding the ports open.
If you search the ITRC forums for tcp_discon or tcp_discon_by_addr you should find examples of how to use ndd to forcibly disconnect TCP connections.
This thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=647225
contains details on how to do this, and it contains the warning text of why it is so important to be careful when using ndd to do this operation.
Regards,
Dave
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2004 03:25 PM
тАО09-12-2004 03:25 PM
Re: How can i close open ports.
If you do that, I suspect you will be able to restart your application without difficulty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-12-2004 03:46 PM
тАО09-12-2004 03:46 PM
Re: How can i close open ports.
IF you want to make the ports to be reused / and address then try to use setsockopt() with SO_REUSEADDR (rick suggestion) and SO_REUSEPORT too before bind operation there.
These options make application to reuse the allocated port with address there.
And you can idenity port's usage of application with lsof tool there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-13-2004 03:10 AM
тАО09-13-2004 03:10 AM