Here's the demo code for today's Thread Application. As you can see results below. It will be printed like below.Download
Your contribution in this blog earns you 5 sessional marks. So keep giving your inputs here.
Your contribution in this blog earns you 5 sessional marks. So keep giving your inputs here.
Sir there is no sequence in execution of threads, how can we sort out??
ReplyDelete
DeleteThats how threads execute. They don't execute in sequence.
And we will use them because We don't want the server to communicate with clients in sequence. Means it should not be like Client1 first and after that client2 and then after that client3. Instead what we want is that server serves all 3 clients at the same time. *Not in sequence*
yes thanks Sir!
DeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
Deletesir agr 5 clients ny at a time server to text kia h to server differentiate ksy kry ga msgs ko ky kis client ko kya reply krna ....................recieve msg knsy client ka h
ReplyDeleteWe will make the clientSocket object as part of our class which is extending thread. So this mean every thread will be communicating with its own client socket.
Deleteclass MyServerApp extends Thread
{
Socket clientSocket;
@override
Void run()
{
}
}