Search code examples
javamultithreadingsocketsnio

java.nio vs new thread for each socket


I am developping a 1 to many server-client application, which is a small project.

Since socket IO is blocking. I am looking for a solution for this.

Could anyone tell me what is the good/bad for each of the 2 solutions?

  1. use java.nio
  2. new a single thread for every client that connected.

Thanks


Solution

  • I tried Apache MINA, it is really really good. I strongly recommend it.