Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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
 
reply
    Bookmark Topic Watch Topic
  • New Topic