(new Thread(new Test.ABC())).start();
how can I overcome with the problem ...
V. Garg wrote:Geeks you are not getting my problem. I am having problem with client in running two diffrent tasks. One for recieving message and the other for sending message.
Can we run 2 Threads over a single class object, with condition of each thread only caring for a single method.
For example if we have 2 methods A() and B()
and 2 Threads t1 and t2
Then is it possible if A() and B() are methods of a single class and t1 cares for A() and t2 cares for B()
You need to modify the class to do what you want. Possible choices are.... Create a new (and different) test classes that calls the different methods -- and start a new thread for each in main. Or make the test class configurable, via a constructor -- and start a new thread for each in main.
I don't see provisions in the code for accepting more than a single client.
It is accepting more than one client.
And run every request in another thread
This will accept all the clients which will come to the server.
Brother I have edited this code after you have made your earlier comment.
Well behaved women rarely make history - Eleanor Roosevelt. tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Javahttps://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire