1
I've a problem when I try to communicate with a server.
If I use the command line:
netstat -np 10.aaa.bbb.12
where 10.aaa.bbb.12 indicates the server address; I obtain an extract with the following results:
tcp 0 87 10.xxx.yyy.4:59438 10.aaa.bbb.12:7955 FIN_WAIT1 -
tcp 0 87 10.xxx.yyy.4:36100 10.aaa.bbb.12:7952 FIN_WAIT1 -
tcp 0 87 10.xxx.yyy.4:59422 10.aaa.bbb.12:7955 FIN_WAIT1 -
tcp 0 87 10.xxx.yyy.4:41678 10.aaa.bbb.12:7951 FIN_WAIT1 -
tcp 0 87 10.xxx.yyy.4:60999 10.aaa.bbb.12:7953 FIN_WAIT1 -
tcp 0 86 10.xxx.yyy.4:59456 10.aaa.bbb.12:7955 ESTABLISHED 21203/sender
tcp 0 87 10.xxx.yyy.4:41694 10.aaa.bbb.12:7951 FIN_WAIT1 -
tcp 0 87 10.xxx.yyy.4:36084 10.aaa.bbb.12:7952 FIN_WAIT1 -
tcp 0 87 10.xxx.yyy.4:60966 10.aaa.bbb.12:7953 FIN_WAIT1 -
tcp 0 87 10.xxx.yyy.4:41711 10.aaa.bbb.12:7951 FIN_WAIT1 -
tcp 0 86 10.xxx.yyy.4:32783 10.aaa.bbb.12:7953 ESTABLISHED 21269/sender
tcp 0 87 10.xxx.yyy.4:60983 10.aaa.bbb.12:7953 FIN_WAIT1 -
tcp 0 86 10.xxx.yyy.4:41728 10.aaa.bbb.12:7951 ESTABLISHED 21225/sender
tcp 0 86 10.xxx.yyy.4:36118 10.aaa.bbb.12:7952 ESTABLISHED 21247/sender
The ports in FIN_WAIT1 have this state since one day. I don't understand why.
All the server ports in above indicated state accepts connection and it seems the server accept commands, but the server doesn't reply as we expect. All replyes waited from the server fall into timeouts.
I may verify the connection with the server using this command line:
nc 10.150.224.12 7955 -w 10 <ts.txt
Where the file ts.txt contains a command that requires a specific reply known to us.
What are the server/client applications? Are you writing one or both? Sockets in this state are still open in one direction - IIRC the server-to-client direction has had
– Attie – 2019-03-05T10:55:55.000shutdown()
called, but the client-to-server direction is still active... Have you calledshutdown(fd, SHUT_RDWR)
andclose(fd)
on the socket from both ends? Is the client application still running? The server application does not need to stay running for sockets to remain in this state.Steps to temporarily resolve the issue are outlined here: https://serverfault.com/a/637203/405400... however this won't help in the long run if your application is poorly written.
– Attie – 2019-03-05T10:57:25.450Can you run
netstat -tnp
on10.aaa.bbb.12
and see what is using those ports? I suspect the process is still running, or is accidentally suspended (^Z
) or similar. – Attie – 2019-03-05T11:00:03.167