jQuery in Action, 3rd edition
The moose likes I/O and Streams and the fly likes PrintStream problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "PrintStream problems" Watch "PrintStream problems" New topic

PrintStream problems

Alistair Macdonald

Joined: Aug 18, 2008
Posts: 1

I'm having problems with PrintStreams. I've created a program which reads and writes data on a socket, using BufferedReader and PrintStreams. If there is data going both ways it works okay. If there is data to send but none to receive i keep getting intermittent errors when i try writing to the socket. Below is a test program that i've knocked together.

The system.out.println statement at the error here label returns true but as far as i can see there is nothing wrong with the socket connection or the printstream. Has anybody come across a similar problem before?



JCE: Please use Code Tags
[ August 18, 2008: Message edited by: Joe Ess ]
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

Welcome to the JavaRanch.
Have a look at our FAQ: How to ask Questions. For example, few of us have time to read 250 lines of code, so you need to Isolate The Problem. You also need to Tell the Details. If you are getting an exception, we need to know what it is. Post the stack trace as it contains valuable information as to the location and circumstances of the exception.
The better question you ask, the more help we can be.

[How To Ask Questions On JavaRanch]
I agree. Here's the link: http://aspose.com/file-tools
subject: PrintStream problems
It's not a secret anymore!