Sponsored Content
Operating Systems AIX How to repair a TCP/IP socket in state: CLOSE_WAIT? Post 302961762 by bakunin on Thursday 3rd of December 2015 09:01:53 AM
Old 12-03-2015
Both, XrAy and agent.kgb are correct: a TCP connection works like a telephone call. First, a so-called "virtual channel" (the call) ist established by both sides (one calls, one picks up the handset). Then, the connection remains in use (the connected people talk to each other) until, finally, one or both sides drop it (they hang up).

The CLOSE_WAIT means, that one has already hung up and this side now is also in the process of dropping the connection. In TCP this is just a bit more complicated with acknowledgements being sent back and forth, but in principle the difference is minimal.

So, what you want amounts to "i want to still talk to someone who just hung up". With a phone you would know what to do: redial and establish a new connection. Here, you do the same: you(r application) needs to reestablish another TCP connection.

Maybe your application was a bit too eager to drop the connection. In this case you must change the application somehow. But this will not change the fact that dropped connections remain dropped, no matter what you want. *)

I hope this helps.

bakunin

_______________
*) Corollary: For better or worse, unlike in Zombie movies dead connections remain dead and won't come back to haunt you.

Last edited by bakunin; 12-03-2015 at 10:14 AM..
These 2 Users Gave Thanks to bakunin For This Post:
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
TCPCONNECT(1)						      General Commands Manual						     TCPCONNECT(1)

NAME
tcpconnect - general TCP/IP client SYNOPSIS
tcpconnect [-irv] [-l localaddr] host port DESCRIPTION
tcpconnect creates a TCP/IP connection to a server running on the machine host, listening to port port. It then reads standard input and sends to the remote server, and data received from the server is printed to standard output. When end-of-file is reached on both standard input and the TCP/IP connection, tcpconnect terminates. OPTIONS
-i Terminate at end-of-file on standard input; don't wait for the server to close the connection. -r Terminate when the remote server closes the connection; don't wait for end-of-file on standard input. -v Verbose mode. Prints a message to standard error when the connection has been established. -l addr:port Bind the local end-point of the connection to IP address addr, TCP port port. Either the IP address or the port, but not both, may be left out, meaning that the operating system gets to choose that part by itself. SEE ALSO
tcplisten(1), telnet(1), tcpbug(1). BUGS
The names of the options are not yet finalized, and may change at a future release. 1997 April 13 TCPCONNECT(1)
All times are GMT -4. The time now is 06:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy