aspose file tools*
The moose likes Beginning Java and the fly likes sockets, streams, and confusion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "sockets, streams, and confusion" Watch "sockets, streams, and confusion" New topic
Author

sockets, streams, and confusion

Adam Confino
Ranch Hand

Joined: Sep 03, 2009
Posts: 48
Hey Java Gurus,

I wrote a simple chat program. Now I am trying to modify the server so that will chat on one port and transfer a file on another. When I run this class, the writeFile() method does not diplay any of its System.out.println() messages which makes me believe it is not being called. Thanks for any help you can give. I really do appreciate it.

Adam



Just Another Guy Hooked on Java
David Kilcy
Greenhorn

Joined: Aug 25, 2009
Posts: 20
In the constructor you call both listen() and writeFile(). First listen() is invoked from the constructor, but it never leaves because you have a while(true) loop in there.
So it never breaks out of the constructor.
Hope that helps.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: sockets, streams, and confusion