• 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

response from upload: hangs

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am uploading files to a server via a socket connection. I create a multipart/form-data upload, sending the required headers, file size.
The upload functions as expected however at the end of the upload I create a reader to fetch a response. This reader hangs for a minute or more
then returns the expected value. Is there something I need to send the server to tell it that I am done and I want the response.
Thanks!

BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));;
while( (strLine = br.readLine()) != null ) {
strResponse+=strLine.trim();
}
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you close the output stream/socket when you are done writing to it? I seem to remember that it is a requirement of the protocol.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic