4 ms·
> Terrible advice. Use NIO and do it properly. Creating 1 thread per connection is for unskilled programmers. Sometimes the simple solutions are the best. Deve
by peter_lawrey 15y ago
> Terrible advice. Use NIO and do it properly. Creating 1 thread per connection is for unskilled programmers.
Sometimes the simple solutions are the best. Developing a complex and clever solution may your feel more skilled. Using a dispacther pattern often doesn't provides a real advantage and or the advantage it provides isn't needed.
I would agree with the suggestion that if you are going to use a dispatcher pattern with NIO, use a library like netty which does this for you. (In any case you don't write it youself)
- speckledjim 15y agoIt's like 100 lines of code. Write it yourself.
- pkl 15y agoI have and if you use blocking IO or NIO its like twenty lines, code just about any one can read and maintain. Why make it more complicated than it needs to be?