This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: sockets, streams, and confusion
 
Similar Threads
Simple program for URL
Limit number of connections
ServerSocket not oppening
Need help with thread pool issue..
Creating a Pipe that connects 2 sockets