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 I/O and Streams and the fly likes InputStream read() blocking 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 » I/O and Streams
Bookmark "InputStream read() blocking" Watch "InputStream read() blocking" New topic
Author

InputStream read() blocking

James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
For a particular customer, our applet is sometimes failing to connect to our servlet.

The applet gets to the inputStream.read(); line and just blocks - seemingly waiting for the first byte of data that never comes. I am using standard applet and servlet connection code (applet POSTs a text/plain String in UTF8 and the servlet returns a text/plain String in UTF8).

Anyone else had this problem or know what the cause/solution might be?

Cheers,
James

NB - The url the applet is calling can be successfully called directly from the customer's browser. And I am unable to reproduce the applet's behaviour at our end.
James Hodgkiss
Ranch Hand

Joined: Jan 22, 2004
Posts: 401
Problem seems to be that my servlet was using a Writer to do its output rather than an OutputStream.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: InputStream read() blocking
 
Similar Threads
Problem converting form data to UTF-8 on solaris
Servlet is downloaded instead of displaying.
Download file HELP?
Java encoding
Problem with sending plain text