Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HttpURLConnection and nio  RSS feed

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?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!