Can't connect with telnet
I have this server:
package assign;
import java.net.*;
import java.io.*;
import java.util.*;
publicclass Server{
publicstaticvoid main(String[] args)throws IOException{
ServerSocket serverSocket =null;
// Returns an object of type interface List.
List l = Collections.synchronizedList(new ArrayList());
boolean listening =true;
try{
serverSocket =new ServerSocket(4444);
}catch (IOException e){
System.err.println("Could not listen on port: 4444.");
System.exit(-1);
}
// accept() returns a new socket.
while (listening)
new ServerThread(serverSocket.accept(),l).start();
serverSocket.close();
}
}
in winXP from the run menu I type "telnet 4444" after I have started the server. But the box disappears quickly. Why can't I connect with telnet?

