How to repair a TCP/IP socket in state: CLOSE_WAIT?


 
Thread Tools Search this Thread
Operating Systems AIX How to repair a TCP/IP socket in state: CLOSE_WAIT?
# 8  
Old 12-18-2015
What application is that you are running? I think what you thought were recovered socket are more new sockets after a cleanup... now if you think or see an issue here it can be a question of time out ( from the other side...) where your remote hosts believed the connection lost and closed it... The issue in this case is it opens a new one again, and after some time you find yourself short of sockets as you are wating for the cleanup process to complete
So you should look at the application side if there isnt something that needs tuning...
# 9  
Old 12-18-2015
Quote:
Originally Posted by bobochacha29
Sorry, my mistake. Maybe something happened, then everything is OK. The sockets state don't change from CLOSE_WAIT to ESTABLISHED
Most likely what happened was that the connections which have been half-removed before were being completely dissolved and then new connections (which you saw as "ESTABLISHED") were made.

AIX has some timeout value between a connection going into state "CLOSE_WAIT" and it being dissolved completely (i don't know it off the top of my head, but it is some no-tunable). IIRC (sorry, its been some years i needed it last) the unit it uses are half-seconds. You can set that to some shorter value to dissolve connections not longer in use quicker if the need arises (usually it doesn't but there is always the exception to the rule).

It might also be that the application is sloppily programmed and the used sockets are not freed properly, stalling the cleanup-process. This might be tricky to track down, but if this is your problem you will have no other option to do just that (and then beat the programmer with a copy of "UNIX Network Programming").

I hope this helps.

@agent.kgb: actually in no universe 2+2 can be equal to 5, at least not when the symbols "2", "5", "+" and "=" are used in way equal to or at least similar to how we use them. For details about why this is so refer to Bertrand Russells "Introduction to Mathematical Philosophy, which is an outstanding classic in this field.

In short: a "(natural) number" is defined as a successor of its preceding number (yes, its a recursive definition) the recursion stopping at zero. So "1" is the successor of zero, "2" is the successor of 1 (or the successor of the successor of zero), and so on. In short we write "S0" for "1" and "SS0" for 2, etc.. Because the addition being defined as it is we can concatenate these lists of successors and arrive at "SS0" + "SS0" being the "successor of the successor of SS0" or, in other words, "SSSS0", which is 4. If we would define "+" as an operation where the operands "SS0" and "SS0" result in "SSSSS0" this the set of natural numbers would be no longer an abelian group regarding to addition which would have a lot more grave consequences than you can possibly envision.

bakunin

Last edited by bakunin; 12-18-2015 at 06:21 PM..
This User Gave Thanks to bakunin For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Terminate processes for CLOSE_WAIT status of TCP

Hello Friends, First of all im sorry for spending extra space in DB of forum with this thread, i know there would be a solution if i kept searching, I need to terminate the process which causes CLOSE_WAIT status of TCP connection via port 8103: -bash-3.00$ netstat -na | grep 8103... (3 Replies)
Discussion started by: EAGL€
3 Replies

2. Shell Programming and Scripting

Read and write to tcp socket

Hello all, I have a requirement to read and write to a tcp socket from an HP-UX shell script. I see a /dev/tcp character device on my servers: crw-rw-rw- 1 root root 72 0x00004f Mar 28 18:37 /dev/tcp So I believe this is what I should use. The problem is that all the... (2 Replies)
Discussion started by: lupin..the..3rd
2 Replies

3. IP Networking

Packets sent from Linux TCP socket

Hello, Our software is using a TCP socket (AF_INET, SOCK_STREAM) to communicate with an Ethernet device. When we send a message, the message object writes itself in full onto the socket's stream buffer before the software invokes send() from socket.h. I'm still researching, but have 2... (1 Reply)
Discussion started by: bix_20002000
1 Replies

4. Solaris

socket in listen state disappears/closes automatically

Hi, I am using solaris 10. I have opened a socket connection using java in solaris 10 operating system, the port went to LISTEN state and able to create new socket connection and the new connections went to ESTABLISHED state. If I issue the command "netstat -an | grep <<portnumber>>", I... (10 Replies)
Discussion started by: kumar3k
10 Replies

5. Programming

Using socket to test a TCP port

Hello, I'm trying to write a small c application to test a tcp port. This works fine for the most part but the default timeout on the connect is very long. I have been reading many posts but and it looks like I need to set the socket to be non-blocking and poll for a result. I have been totally... (2 Replies)
Discussion started by: tjones1105
2 Replies

6. UNIX for Dummies Questions & Answers

Hitting with custom port in CLOSE_WAIT state for long time in solaris 10

Hi, Occasionally I am getting the port state in CLOSE_WAIT for long time in the solaris server. I am not sure is it application problem or not. Because we are using port 9009 for Tomcat process in our web application, some time when I start the application, the port 9009 is in CLOSE_WAIT... (0 Replies)
Discussion started by: mgmk.84
0 Replies

7. AIX

TCP/IP socket binding problem

I have what appears to be a unique socket problem, although admittedly my tcp/ip programming experience is relatively limited. I have a AIX server process using TCP/IP berkely sockets, and a Windows (C#) process. The windows process takes input from a user and sends a message to the Unix... (1 Reply)
Discussion started by: adiaconou
1 Replies

8. UNIX for Dummies Questions & Answers

Which application has a TCP socket open

If I do a netstat -a I can see all the sockets currently open, is there a way that I can tell which application is holding open these sockets ? (3 Replies)
Discussion started by: murphyboy
3 Replies

9. Programming

Confusion about TCP/IP socket programming

Hello there chaps. First of all, i'm no TCP/IP-wiz, so forgive me if this is a stupid question. I've been messing around with filetransfer using sockets, and there is one thing that confuses me. This is how it's set up: A server app listens on a port for a client connection. When it... (3 Replies)
Discussion started by: crippe
3 Replies

10. Programming

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... (1 Reply)
Discussion started by: teledelux
1 Replies
Login or Register to Ask a Question