Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

URLConnection timing out before response is received - setReadTimeout does nothing  RSS feed

Mike Hul
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using a socket connection to send a POST request. Here's some code:

This works fine for requests where the response is relatively small. But for larger responses, the last step here often times out and throws an IOException. Setting the ReadTimeout property appears to do nothing, the connection just ignores it. Is there any way to set the timeout to a larger number WITHOUT resorting to using Apache HttpClient (or Sun's HttpClient for that matter since I'm working in the Google Web Toolkit environment and for some reason it doesn't allow you to use it).

Any help is appreciated. Thanks in advance.
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!