File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Thread not opening connections properly. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Thread not opening connections properly." Watch "Thread not opening connections properly." New topic

Thread not opening connections properly.

Declan Conlon
Ranch Hand

Joined: Jul 03, 2001
Posts: 34
I'm not sure what is wrong with my applet. Originally I had an applet that accessed a file and outputted it to a servlet. I then wanted to add a progress bar but the file access and transfer process were to intensive to make the progress workable. I moved the progress bar to a thread and the file access and transfer also. Now the progress bar works but there seems to be a problem with connecting to the servlet. A case of fix one thing brake another. Has anyone any ideas as to why this may be the case. The code is the same as I just pass datainputstream and a dataoutputstream to the thread and reuse the same codefrom there. The file inputs correctly and I have tried the older version of the code and it still works. Thanks for any help and ideas you can give.
Sarath Mohan
Ranch Hand

Joined: Mar 17, 2001
Posts: 213
Hi while progg with threads,
plz take care of the following things
1)Starting point of each thread
2) Is these threds use a shared resource. If yes, then check any possiblilty of concurrent access.
3)Whether All threads stopped properly.

Sarath Mohan
Declan Conlon
Ranch Hand

Joined: Jul 03, 2001
Posts: 34
It's not one of the ususal thread problems, it is something a little more subtile than that. I believe the problem to be with my DataOutputStream not being initialised in the thread despite being passed references to the streams. Anyone think that sounds familiar?
jQuery in Action, 2nd edition
subject: Thread not opening connections properly.
Similar Threads
Transfer control from Third party Applet.
Access Control Exception
data loss during file transfer from applet2servlet
Applet not communicating with Servlet, Help Required.
file upload using HTTP & the Transport layer