Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread not opening connections properly.

 
Declan Conlon
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Declan Conlon
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic