multithreading - HTTP posts and multiple threads in Java -
i writing internal java applet file uploads via http. started using built in clienthttprequest worked great if want post 1 after another. when try have multiple threads post @ same time, on server side freaks out , connection hang large files while still uploading smaller files. (large seems around 10 megs) after lots of looking, not able find timeout set recover error, found clienthttp apache provide mechanism set timeout. problem while claims able work in multi-threaded program, 1 request after another. have found lots of example code httpclient says work multiple threads , have made adjustments code incorporate changes, none of them make difference, , still stuck 1 thread.
while multiple threads not required release (httpclient seem bit faster clienthttprequest), nice speed boost since there lot of smaller files sent @ same time.
the files being sent on http because want use same authentication of logged in user using session cookies.
so looking either way set timeout clienthttprequest or code httpclient send multiple requests @ same time promised.
i sharing same httpclient instance between threads , using multithreaded connection manager (it won't work without this) docs , doesn't help.
any appreciated , let me know if need clarifications.
seeing sample of code might help.
perhaps problem applet environment. testing in appletviewer, ide, or in browser? browsers setup limit number of connections same web server 2. might try adding main() , running standalone see if fixes problem.
Comments
Post a Comment