• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlet/applet communication failure

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
see http://s1.sun.com/Search/fortebugs?qt=content-length&col=obug&qp=&rf=0
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic