I am writing a small TCP socket program. It connects users to IMAP server(Telnet). It has fixed number of threads, means it does not create a new thread when a new user connects.
These threads acts as service threads which perform small tasks and passes the control to next thread.
1.First question: Is this approach is good enough or should I make new thread for every user. The problem I see in that they have to carry the same functions and that means they will be in block state anyways and
one thread is executing, therefor writing small service threads seemed better to me.
Users limit is thought to be 100 users.
2. The other question is I am using only one socket(local) where all users communicate. I tested little bit
and it seemed okay. Is using one socket for this application is good or should I use multiple sockets?
How many connections can a socket queue in?