Page 1 of 1

Proper disconnect from web page - ttl lsof

Posted: Tue Aug 01, 2006 9:47 pm
by amp
Hi,

I use a proxy to access a remote camera server behind a firewall

I am streaming live video from the remote server using the following html code on my web page:
...
http://www.allenintech.com/cgi-bin/zms? ... =10&ttl=30
....

Of course the streaming stops after 30 seconds (due to ttl=30)

When I access the web page and list open files using,

/usr/sbin/lsof -i tcp:80,

Open connections from the client to the remote server are properly shown. See partial listing of lsof command:
  • ...
    TCP allenintech.com:http->wme.allenintech.com:59419 (ESTABLISHED)
    TCP allenintech.com:60790->aitsurv.allenintech.com:http (ESTABLISHED)
    ...
When te web page is closed, lsof i tcp:80 show the connections closed:
  • ...
    TCP *:http (LISTEN)
    TCP *:http (LISTEN)
    ...
Since I want "continuous streaming", I eliminated the ttl parameter or set it to zero.

I can view the live feed from the remote camera server. lsof -i tcp: 80 shows the connection from the client to the remote server. See partial listing below:
  • ...
    TCP allenintech.com:http->wme.allenintech.com:59023 (ESTABLISHED)
    TCP allenintech.com:62345->aitsurv.allenintech.com:http (ESTABLISHED)
    ...
BUT when the web page is closed, the connection to the remote camera server remains open as shown by the following lsof -i tcp: 80 command:
  • (NOTE: ttl=0 or ttl is eliminated in the parameter list)
    ...
    TCP allenintech.com:62345->aitsurv.allenintech.com:http (ESTABLISHED)
    ...
As you can guess, after many opening and closing of the web page, particularly when viewing multiple camera these "bogus / phantom " open / ESTABLISHED connection degrade system performance significantly.

Can anyone point me to how to stream the video and have the remote server properly disconnect when the web page is close?

I am running zm 1.21.4
proxy server: RH 9.0, apache 2.0.40
remote server: Fedora 4, apache 2.0.54

Thanks in advance

amp