// Allocate large content input / output buffers
ContentInputBuffer inbuffer = new ContentInputBuffer(20480, conn);
ContentOutputBuffer outbuffer = new ContentOutputBuffer(20480, conn);
// Set up the HTTP service
AsyncHttpService httpService = new AsyncHttpService(
inbuffer,
outbuffer,
httpproc,
new DefaultConnectionReuseStrategy(),
new DefaultHttpResponseFactory());
httpService.setParams(this.params);
httpService.setHandlerResolver(this.reqistry);
conn.getContext().setAttribute(HTTP_ASYNC_SERVICE, httpService);
}