Two Laptop Bag
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

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.


Just Another Guy Hooked on Java
David Kilcy

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.
I agree. Here's the link:
subject: sockets, streams, and confusion
It's not a secret anymore!