Hi Sean,
Thanks a lot for your help! I have two questions here: In Socket method whether we have to write port number 10001 or also we have to write IP address and port number otherwise how client will come to know only on port number that which server to go.
ANd what is handler and purpose of it use:
chatHandler c = new chatHandler(client);
I checked the link you sent me. But i want to confirmed the following code you have written(not link) is enough to make only connection to server and how can I check whether client is connected to server or not without sending or receiving data?:
public class chatServer{
public chatServer() throws IOException
{ // initialise new ServerSocket
ServerSocket s = new ServerSocket(9999);
// loop listening for connections and
// instantiate a new handler for each one
while(true){
Socket client = s.accept();
chatHandler c = new chatHandler(client);
c.start();
}
}
public static void main(
String[] args) throws IOException {
chatServer cs = new chatServer();
}
}
Please help me ,
Thanks in advance,
Angela