- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Closing "established" socket that is stale
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
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-30-2003 05:51 AM
тАО09-30-2003 05:51 AM
Closing "established" socket that is stale
So, what I am wondering is there anyone that has a utility or C code that would be able to get the socket descriptor information from the kernel when provided with the IP and port information. Using this socket descriptor, then be able to force the connection into a fin_wait2 state so that the OS will clean up the connection without having to take the rest of the application down.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2003 06:02 AM
тАО09-30-2003 06:02 AM
Re: Closing "established" socket that is stale
Alternatively, you could have your app keep track of all connections and periodically try to send some data to each. If the link is down, then an error would be returned and your app could clean up. Of course, this depends on whether the application layer protocol you are using allows superfluous data.
I don't think it would be possible for one userland process to close the sockets belonging to a different process. I think you would need a kernel mod to do that.
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2003 06:07 AM
тАО09-30-2003 06:07 AM
Re: Closing "established" socket that is stale
If activity ends, then the listener should be on an an acceped socket that can be closed with a shutdown.
This is an application problem, not an Admin problem, but I have your answer.
The socket number can be reopened
and then shutdown(int socket).
if SO_KEEPALIVE is set you can hold it open until the close is sent from the remote end.
I would actually complete my data transmissions and close the listener end if there is no response in 120 seconds.
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2003 06:19 AM
тАО09-30-2003 06:19 AM
Re: Closing "established" socket that is stale
I am curious, you say the connection can be reopened and then using the shutdown() function you can close it, but this is assuming you now the socket number. To my knowledge the only two places that information can be found is either in the program that opened it or in a kernel table, neither of which I know how to access. Can you please provide some examples of how to obtain this information?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2003 06:28 AM
тАО09-30-2003 06:28 AM
Re: Closing "established" socket that is stale
Hacking up the system (with a kmod) or writing another app to fix the problems of your main one won't fix the root problem, it will just mask it and possibly introduce other problems.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2003 08:51 AM
тАО09-30-2003 08:51 AM