Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > httpclient executeMethod() leaves early

Reply
Thread Tools

httpclient executeMethod() leaves early

 
 
Bastian
Guest
Posts: n/a
 
      11-21-2005
hello ng,

I have a problem with the executeMethod(putmethod).

When initiating the mehtod i see the upload on my network monitoring
tool. but when this tool shows nomore uplaod, the method stays active
for about 4 secs. while this time my cpu usage raises to 100% and than
falls back to normal, when the method is left.

Why does ist stay within the putmethod? I tried to handled it with the
setSoTimeout() but without success.

What can i do?

thx
bastian

code:
PutMethod method2 = null;
try {
method2 = new PutMethod(url+"/"+remote);
method2.setRequestEntity(
new InputStreamRequestEntity(
new FileInputStream( local ) ) );
} catch (FileNotFoundException e) {
log.warning("File doesnt exist: " + local);
e.printStackTrace();
return false;
}
httpclient.getHttpConnectionManager().getParams(). setSoTimeout(50);

long start = 0, time = 0, bytes = local.length();
try {
// Execute the method.
start = System.currentTimeMillis();
int statusCode = httpclient.executeMethod(method2);
time = System.currentTimeMillis() - start -
method2.getParams().getSoTimeout();
System.out.println("Uploading " + local.getName() + " complete. " +
bytes/time + " KB/sec");
System.out.println("start: " + start);
System.out.println("time : " + time);
System.out.println("timeo: " + method2.getParams().getSoTimeout());

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MSXML4 - parsing XML Leaves with multiple parameters milesd XML 0 06-14-2005 11:38 AM
ghostscript leaves windword processes SpamProof ASP .Net 1 02-25-2004 06:48 PM
Deleting emails leaves a thingy... Shagrat Computer Support 4 02-10-2004 09:05 PM
does build-in firewall in router leaves ports open? Aunt Agatha Computer Support 1 02-07-2004 02:12 AM
How to delete temporary files when the user leaves the web page? Jorge_Beteta ASP .Net 4 01-12-2004 08:21 AM



Advertisments