Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Thread not opening connections properly.

 
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.
 
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?
 
What are you doing in my house? Get 'em tiny ad!
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic