8

I need to manage long running TCP socket connections to an external server from my Java application. I'm looking for a good socket pool so I will be able to re-use the sockets. Are there any suggestions?

David Rabinowitz
  • 29,904
  • 14
  • 93
  • 125

2 Answers2

6

You could have a look at building a socket pool on top of Commons Pool.

Mark
  • 28,783
  • 8
  • 63
  • 92
  • 2
    Though about it, but I had bad experience with it in the past. Also, its code is was not optimised to Java 5/6 - no Generics, no concurrent collections, etc. – David Rabinowitz Jun 02 '09 at 10:50
  • 1
    Good point. I guess that is one of the problems with some of the commons projects - collections being another example. – Mark Jun 02 '09 at 12:33
3

Koders.com has an implementation here. I can't vouch for it's functionality, however, so you should run a few tests on it.

Brian Agnew
  • 268,207
  • 37
  • 334
  • 440