- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How can I avoid tcp ports being left open, (& ...
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
Forums
Discussions
Discussions
Discussions
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
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
03-21-2002 08:10 PM
03-21-2002 08:10 PM
On four occasions now I have observed one of our core applications terminating and leaving its socket "in use". Further attempt to open it return error 226 (address in use).
I have successfully used the method described in thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xbe06a22d6d27d5118fef0090279cd0f9,00.html
to free it up.
What I would really like to know is what causes the tcp/ip port to get blocked and more particularly what can be done to avoid this happening in the future?
The problem seems to occur when multiple users are using a socket on the same port for an extended period and over the network. Today's blockage probably occurred when I was retrieving data in Japan from the lab in Australia at the same time as somebody was also retrieving the data from Singapore.
Attached is the code fragment that handles the socket connection.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2002 01:43 AM
03-22-2002 01:43 AM
Re: How can I avoid tcp ports being left open, (& unavailable) under HP-UX 11?
Note that socket connections remain in the TIME_WAIT state for a period of time (4 minutes by default I think) after the socket has been closed. If you try to bind() to a port that still has TIME_WAIT sockets you will get the 'address already in use' error. After the 4 minutes pass things are ok again.
You can use the setsockopt() call with the SO_REUSEADDR option to force the application to bind to this port even though the TIME_WAIT sockets still exist.
This can be a little dangerous because it also allows you to bind to sockets that are still used by other processes in the LISTEN state.
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2002 11:11 AM
03-22-2002 11:11 AM
Re: How can I avoid tcp ports being left open, (& unavailable) under HP-UX 11?
Winnt boxes are known to have a flaw in their tcp/ip code which closes their socket before the final FIN packet has been acknowledged. They send it and assume it has been received by the other end when they should retransmit it if they don't get an ack back. There is a fix for that but you have to beg MS support for it.
Ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2002 03:10 PM
03-25-2002 03:10 PM
Re: How can I avoid tcp ports being left open, (& unavailable) under HP-UX 11?
Yes the boxes at the other end of the socket are Winnt.
I groped the MSDN Knowledge base and found the problem described in Q166186. They indicate that it is fixed in the latest US Service Packs for NT 3.51&4.0/Server and Workstation without the specifics. I have some more digging to do. The machine I suspect is the culprit is running NT 4.0 Server Sp4. The KB article is dated April 16, 2000
I am also responsible for the code at the Winnt end. The code at the Winnt end looks moderately clean but there is some potential for being a little more draconian in closing the socket following errors.
Thank-you for a well targeted response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2002 12:57 PM
03-28-2002 12:57 PM
SolutionTry:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q254930
Expect you really should upgrade to SP6a before installing the patch. We installed it on our SP6a systems and it works fine. No idea what it will do on SP4.
Just call Microsoft support and explain that you have the problem from Q254930 before you give them your credit card number and they will email you the solution without charging you. I remember there was a password involved somewhere.
Ron