public static void main(String[] args) {

		try {
			serverSocket = new ServerSocket(4000);
		} catch (IOException e) {
			System.out
					.println("EchoMultiServer: could not listen on port: 4000, "
							+ e.toString());
			System.exit(1);
		}
		System.out.println("EchoMultiServer listening on port: 4000");

		boolean listening = true;
		while (listening) {
			// EJERCICIO: aceptar una nueva conexi�n
			// EJERCICIO: y crear un Thread para que la gestione
			Socket clientSocket = null;
			try {
				clientSocket = serverSocket.accept();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			EchoMultiServerThread multi = new EchoMultiServerThread(
					clientSocket);
			multi.start();
		}

		try {
			serverSocket.close();
		} catch (IOException e) {
			System.err.println("Could not close server socket."
					+ e.getMessage());
		}
	}