(Note: I originally asked this question on the "Network Engineering" side, but a moderator there rejected it as "off topic" and told me to ask here instead.)
I am running a video surveillance server called ZoneMinder (version 1.26.5) on a Fedora 18 Linux box. ZoneMinder has a web-based user interface and uses a CGI executable called "zms" to transmit an MJPEG video stream to a web browser over TCP. The problem is that sometimes the video stream connection does not terminate properly; if I am viewing a video stream and close the browser window, the underlying TCP connection remains open and the zms process on the server continues to send video frames across the network. This occurs even if I terminate ALL instances of the browser on the Windows machine (verified using Task Manager). My expectation is that Windows should immediately shut down the TCP connection once the browser process terminates, but for some unknown reason that doesn't always happen, and Windows continues to accept packets on the connection indefinitely. When this problem occurs, the zms process on the server still sees the connection as open and will continue to stream video until either the Windows machine is powered down or the zms process is killed (manually, from the command shell). When reviewing surveillance events it's not uncommon to accumulate a dozen or more of these "zombie" zms processes; if I don't log on to the ZoneMinder server machine via SSH and kill these processes manually they will continue to run indefinitely, consuming disk and network I/O bandwidth and bogging down the rest of the system.
Once in the failed state, running netstat on the Windows machine shows the TCP connection is in the FIN_WAIT_2 state. A Wireshark capture shows that the Windows machine is still acknowledging segments on the connection even though there is no longer a running process receiving that data.
I have 3 Windows machines: One desktop running Windows 7 Pro SP1, one desktop running Win 7 Home Premium SP1, and one laptop running Win 7 Home Premium SP1. Of these three, the two desktop machines exhibit the problem intermittently, whereas the laptop never exhibits the problem.
I normally use the Firefox browser, but I also tried Chrome. Both work 100% on the laptop and fail intermittently on the desktops. Using Firefox and Chrome on other platforms that I have tried, such as Linux and Android, never exhibit the problem.
One of the Windows machines that fails is connected to the same gigabit switch as the ZoneMinder server box; the Windows laptop that always works is connected to a WiFi AP and reaches the ZoneMinder server through a second GigE switch. The Android devices connect both from inside and from outside beyond the firewall with no issues.
To eliminate the possibility of a network driver issue, on one of the desktop machines I tried swapping out Realtek network card with an Intel NIC, but the failure still occurs.
I've now run out of ideas; how can I troubleshoot this further? I can provide Wireshark captures if that would be helpful (they are large - ~100MB - so I've left them off for now).
Thanks for your help!