Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HttpURLConnection and nio

 
Jerry Pulley
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got an app that runs many (1K+) simultaneous HttpURLConnections, each in a separate thread. It's up for refactoring and I'd like to change this approach to use a selector. I would like, however, to keep the existing architecture, so I'd rather not go straight to the sockets.
The only thing I can think of is to open a channel on each HttpURLConnection.getInputStream() (and maybe getOutputStream() ?). Has anybody done anything similar? I haven't used java.nio yet; is this approach rational?
thnx,
jp
 
I was born with webbed fish toes. This tiny ad is my only friend:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!