Connection Close

Put your problem here if it does not fit any of the other categories.

Connection Close

Postby nisha » Wed Jun 25, 2008 10:21 am

Hi All,

I am using HttpClient for connecting to server. How can i close the connection once my work is done?... I tried with
httpClient.setConnectionTimeout(90);

However it dint work.. Can anyone tell me how to close the httpClient connection? Waiting for your reply..


Thanks and Regards,
nisha
nisha
Experienced Developer
Experienced Developer
 
Posts: 80
Joined: Fri Feb 15, 2008 7:52 am

Top

Postby Jesmiatka » Wed Jun 25, 2008 2:08 pm

You can use .disconnect();
Jesmiatka
Senior Developer
Senior Developer
 
Posts: 164
Joined: Mon Feb 04, 2008 3:37 pm
Location: Netherlands

Postby nisha » Thu Jun 26, 2008 6:05 am

Hi,

Thanks for your reply .... I dint get any method like .disconnect()... httpClient.disconnect() is not there... Can you explain me how to use that method...
I tried with
postMethod.releaseConnection();
Still its not working perfectly...


Regards and Thanks,
nisha
nisha
Experienced Developer
Experienced Developer
 
Posts: 80
Joined: Fri Feb 15, 2008 7:52 am

Postby Jesmiatka » Thu Jun 26, 2008 10:43 am

Sorry my fault, was confused with URLConnection.
Anyways, I do not see an option to close the connection. It might work if you set the parameter to null.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. httpClient = null;
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
Jesmiatka
Senior Developer
Senior Developer
 
Posts: 164
Joined: Mon Feb 04, 2008 3:37 pm
Location: Netherlands

Postby nisha » Fri Jun 27, 2008 7:40 am

Hi,

I tried with httpClient = null ... Its not working still :(

Regards and thanks,
nisha
nisha
Experienced Developer
Experienced Developer
 
Posts: 80
Joined: Fri Feb 15, 2008 7:52 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 17 guests