public Client() throws IOException {
		 try {
				ArrayList<InetAddress> serverIP = getServerIP();
				ArrayList<ClientThread> ClientThreads = new ArrayList<ClientThread>();
				
				for (int i=0; i<serverIP.size(); i++){
						Socket socket = new Socket(serverIP.get(i), 4444);
						ClientThread lookForActiveServers = new ClientThread(socket);
						lookForActiveServers.start();
						ClientThreads.add(lookForActiveServers);
				}
				
				try {
				    Thread.sleep(5000);                 //1000 milliseconds is one second.
				} catch(InterruptedException ex) {
				    Thread.currentThread().interrupt();
				}
				
				for (int i=0; i<ClientThreads.size(); i++){
					if(ClientThreads.get(i).isThisOneConnectedLiao() && noConnection){
						this.clientThread=ClientThreads.get(i);
						this.socket=ClientThreads.get(i).getSocket();
						noConnection=false;
					}
					else {
						ClientThreads.get(i).getSocket().close();
					}
				}
	        } catch (UnknownHostException e) {
	            System.err.println("Don't know about host " + this.clientThread.getSocket().getInetAddress());
	            System.exit(1);
	        } catch (IOException e) {
	            System.err.println("Couldn't get I/O for the connection to " +
	            		this.clientThread.getSocket().getInetAddress());
	            System.exit(1);
	        } 
			 PrintWriter pw = new PrintWriter(this.clientThread.getSocket().getOutputStream(), true);
			 BufferedReader br = new BufferedReader(new InputStreamReader(this.clientThread.getSocket().getInputStream()));
			this.output = pw;
			this.input = br;
				 
	 }