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 jarias <ja...@ujaen.es> on 2011/01/13 11:20:59 UTC
Problem closing a connection
Hello, I have one problem with HttpClient class. I am using this class to
connect to webdav repository. I do the task in the server.
After do it, the connection is open. I have tried to call this function:
_httpClient.getHttpConnectionManager().closeIdleConnections(0);
but the connection does not close. I think is beacause this connection is
not idle yet.
Could anybody help me?
I have written the code I am using, it gets dav properties of a resource:
HttpClient _httpClient = new HttpClient();
Credentials creds = new UsernamePasswordCredentials("user",
"pass");
_httpClient.getState().setCredentials(AuthScope.ANY, creds);
DavMethod pFind = new PropFindMethod("",
DavConstants.PROPFIND_ALL_PROP,
DavConstants.DEPTH_INFINITY);
_httpClient.executeMethod(pFind);
MultiStatus multiStatus = pFind.getResponseBodyAsMultiStatus();
DavPropertySet props =
multiStatus.getResponses()[0].getProperties(200);
Collection<DefaultDavProperty> propertyColl =
props.getContent();
pFind.releaseConnection();
_httpClient.getHttpConnectionManager().closeIdleConnections(0);
Thank you in advance.
--
View this message in context: http://old.nabble.com/Problem-closing-a-connection-tp30660937p30660937.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