Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12111

Multithreading server: one thread per client connection

$
0
0

I have multi-threading java application. I am wondering if this approach is correct. From my main method I will start two threads. One thread start listening for in coming client connections (this is a client-server application). Once a client connects with the server it starts a new thread to handle the client and this continues for all the client connections. The other thread started by the main program handles the messages received by the clients which are in a common buffer.

My question is:Main thread starts a thread (server), this thread in-turn starts many threads. Is this correct?


Viewing all articles
Browse latest Browse all 12111

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>