Sockets in close-wait state

To find sockets in CLOSE-WAIT state:

ss -ant state close-wait

I have about 10 of them at the moment going to one of HDHR devices on port 65001
They should be closed.

@tmm1 The application should not be leaving sockets in this state. They normally get closed. I suspect they are the result of mishandling the 6s timeouts as their number corresponds to the number of 6s events in the logs after the most recent restart.

This is a normal state and is controlled by the OS.

This is not a normal state. The application did not close the socket.

Transmission Control Protocol - Wikipedia

CLOSE-WAIT Waiting for a connection termination request from the local user.

Okay thanks there must be a missing close.

1 Like

What is that TCP port used for on an HDHR?

Did you verify the pid on those CLOSE-WAIT sockets belongs to channels-dvr?

Or a close on a wrong socket. I have two HDHR devices and the CLOSE-WAIT sockets are only to one of the tuners. Could be related to 6s timeout issue Stable Cable Connection: "no data was received for 6s"

It's not related. The 65001 is a control port and is infrequently used.

1 Like

Only every 2 seconds to obtain signal stats for each connection transmitting video.

A new TCP connection is created every 2s and left in close wait?

No. The data is transmitted on the connection. I wasn't trying to bring the derailment back on thread.

@hal9000 Please submit diagnostics and give us the UUID it gives you.

1 Like

e408ea93-6b44-4d5e-902d-187b80e3501a

1 Like

Could your iptables rules be involved here?

I am not using it. Also a different protocol - tcp vs. udp. Thanks for asking.