File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PrintStream problems

 
Alistair Macdonald
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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?

Cheers

Al

JCE: Please use Code Tags
[ August 18, 2008: Message edited by: Joe Ess ]
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic