hey.. according to my text, yes i am suppose to implement a multithread socket communication between server and client.. however, i do not understand some of codes that is given to me and i hope someone could explain to me.. thanks a million.. these are my codes for the server that i do not understand..
ServerSocket serverSocket = new ServerSocket (8000);
//wad does the 8000 mean?
while(true)
{
Socket connectToClient = serverSocket.accept();
System.out.println ("Start thread for client" + clientNo);
HandleAClient thread = new
HandleAClient (connectToClient,clientNo);
thread.start();
clientNo++;
}
// do not really know wad is happening here.. hope someone can help.. thanks once again..=)
//wad does the 8000 mean?
Did you read manual? This is port number.
// do not really know wad is happening here.. hope someone can help.. thanks once again..=)
Each incoming connection looks like new socket created using server socket. Common model for handling number of incoming connection - creating new thread for each new connection. So HandleAClient is class based on Thread class.