I am developing an iOS and Android app (using ionic/angular)
I have the following situation:
I have a view that basically does this:
<div ng-repeat="monitor in monitors">
<img ng-src = 'http://myserver.com/cgi-bin/videoFeed?id={{monitor}}' />
</div>
Each monitor is actually an IP camera and what we are doing here is transmitting live feed as continuous JPG images (multipart/mime).
What therefore happens is the img tag keeps showing new images continuously making it look like a live video feed
The problem I am facing is when we exit the view, it looks like angular still keeps the HTTP connection open and the server keeps the connection open on its side as a result. The server launches an instance of 'videoFeed' per connection, and I can see the instances don't go away even long after (15-20 minutes) I exit the view.
Is there any possible way to clear out these connections forcibly from the client?
I searched in SO for other such questions and they all talk about HTTP timeouts - which is not relevant in my case, as this is a continuously updating image feed with one image tag and the only time it needs to abort is when we exit the view.
Thanks