This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet/applet communication failure  RSS feed

 
Ken Siberz
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am plagued by an intermittant failure of getInputStream after successfully opening a URL connection to a servlet.
My applet periodically opens a URL connection to a servlet to receive data. The servlet acquires the data and sends an array of strings to the applet in an ObjectOutputStream. After a number of successful responses from the servlet, the applet hangs on a "connection.getInputStream()" method call. Here is part of the code, which is executed each time the applet needs data:
URL dataURL = new URL(...);
URLConnection connection = dataURL.openConnection();
connection.setUseCaches(false);
InputStream URLin = connection.getInputStream();
Here's where it eventually hangs -- after from 5 to 50 successful iterations. I am testing with JRun 3.0.
Thanks for any help!
Ken
 
Dorj Galaa
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you use under jdk1.3 from servlet to applet must declare Contentlength=how many bytes
 
Dorj Galaa
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see http://s1.sun.com/Search/fortebugs?qt=content-length&col=obug&qp=&rf=0
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!