Originally Posted by akmkat
the problem is, that, when start client1, the thread1 from the server starts to serve this client, and when I start another client client2, this thread does not start, until client1 and thread1 get finished. Same thing happens when I start 3 threads simultaneously, but the server and the workers supposed to serve all the clients at the same time, but it is working on "first come first serve" basis.
The problem is ur calling the run() method of ur worker from ur main(). when u call ur run method directly multithreading
has no use in ur program bcoz the control will return to the main() module only when the run method finishes,so ur server will not server mutiple clients....so what u have to do is call the w.start() (assume w as ur worker object) this will automatically call ur run() module in a seperate thread and the main thread remains in the same place where it was, so ur while loop
will get repeatedly executed and it will server multiple clients
change u have to make:-
w.start() instead of w.run()
assume w as ur woker object