Bitcoin Forum
May 12, 2024, 11:18:57 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Multithreading server: one thread per client connection  (Read 238 times)
aliza (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
November 12, 2016, 10:54:48 AM
Last edit: November 16, 2016, 10:40:10 AM by aliza
 #1

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?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!