![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| socket close() -w- pthreads linux 2.6.18.2-34 (suse) SMP | ramen_noodle | High Level Programming | 1 | 02-06-2008 06:22 AM |
| any way to close socket | pa.chidhambaram | UNIX and Linux Applications | 3 | 02-01-2008 06:12 AM |
| Close Socket at HP-UX | Renato Gregio | HP-UX | 2 | 08-14-2007 07:04 AM |
| socket close hangs and CPU go to 100% | arico | HP-UX | 0 | 08-22-2006 09:35 AM |
| Sniffing an established port | matrixmadhan | IP Networking | 5 | 06-16-2005 06:03 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
C Prog to close a socket in established state
I have a SUN environment running an WebLogic that communicates w/a 3rd party running IIS. When the IIS site goes down (frequently), I am stuck with sockets in an ESTABLISHED state, and cannot seem to figure out how to avoid this. No exceptions are thrown as I can still open connections to the IIS site, but no data is returned.
What I would like to do is to determine from lsof -i tcp@host, the file descriptors, and then determine how long they have been in ESTABLISHED state, and then close them if they are older than say 1 hour..... Any ideas???? As always- all help and assistance is greatly appreciated. |
| Forum Sponsor | ||
|
|
|
|||
|
Here ya go
No point in replicating work,
unless you want to, go to www.monkey.org/~bugsong/dsniff.html This is a suite of programs that are used for network troubleshooting, please respect them as such. There is a tool in the suite called tcpkill, you can download the source tar file, and tear it apart. He does some very cool stuff with networking here, I suggest a good read of the whole thing, very informative. THis is also available from the BSD ports and packages collections. You should be able to take the tcpkill code and work it into a script ( if you want to do that ) with lsof providing the input. Obviously you'll need to compile it, and I believe that it does depend on some of the other files for declarations and such, check the Makefile for exactly what you have for options. HTH, loadc |
|||
| Google The UNIX and Linux Forums |