You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by rpinto <sa...@gmail.com> on 2012/06/05 11:03:35 UTC

Multiple Get to same url (snapshot to video)

Hi there,

I'm trying to simulate a movie by getting, multiple times, an image from an
ip camera, accessing an url that displays a current snapshot. Do you have
any suggestion to do it without having to close the connection, avoing
overhead?

Thanks in advance.

Best regards,
rpinto 
-- 
View this message in context: http://old.nabble.com/Multiple-Get-to-same-url-%28snapshot-to-video%29-tp33962820p33962820.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Multiple Get to same url (snapshot to video)

Posted by Sam Crawford <sa...@gmail.com>.
Most IP cameras in my experience have a very minimal HTTP server, and
may not support persistent connections. The first thing I would
suggest is trying it using a simple command line tool like cURL. For
example, if you run the following and see debug output stating
"Reusing existing connection" then you know it supports the
functionality you need.

curl -v "http://foo.bar.com/image.jpg" "http://foo.bar.com/image.jpg"
> /dev/null

Apache HttpClient will reuse connections by default. All you need to
do is pause (e.g. Thread.sleep(...)) between HttpGet requests. You can
enable the HttpClient logging features
(http://hc.apache.org/httpcomponents-client-ga/logging.html) to see
whether or not HttpClient is able to reuse connections.

Hope this helps,

Sam



On 5 June 2012 10:03, rpinto <sa...@gmail.com> wrote:
>
> Hi there,
>
> I'm trying to simulate a movie by getting, multiple times, an image from an
> ip camera, accessing an url that displays a current snapshot. Do you have
> any suggestion to do it without having to close the connection, avoing
> overhead?
>
> Thanks in advance.
>
> Best regards,
> rpinto
> --
> View this message in context: http://old.nabble.com/Multiple-Get-to-same-url-%28snapshot-to-video%29-tp33962820p33962820.html
> Sent from the HttpClient-User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org