On Fri, 2014-01-10 at 13:51 +0000, Boxer, Aaron wrote:
> > I have a CD with about 1000 files on it. I need to upload them (via WebDAV 
> > client).
> >
> > Currently, I go one by one through the files, and put to the server using 
> > InputStreamEntity .
> >
> > IS there a better way?  Can I use an NIO buffer, to avoid copy into user 
> > space ?
> >
> 
> 
> This is one (rather few) cases where HttpAsyncClient may do a better job
> than blocking HttpClient due to its support for zero copy uploads /
> downloads
> 
> http://hc.apache.org/httpcomponents-asyncclient-4.0.x/
> http://hc.apache.org/httpcomponents-asyncclient-4.0.x/httpasyncclient/examples/org/apache/http/examples/nio/client/ZeroCopyHttpExchange.java
> 
> 
> 
> Thanks, Oleg! That is exactly what I want.
> 
> If I make 100 asynch posts, are they executed in sequence? 

HttpAsyncClient executes requests concurrently given the maximum limit
of connections allowed by the connection manager (per host and total).
If want all 100 requests to be executed in parallel you need to increase
per host limit to 100 and total limit to n >= 100.   

>  Also, what if I want to cancel
> the posts?
> 

Well, if you want to cancel the posts then go ahead and cancel them.

Oleg



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

Reply via email to