protected void waitForClient() {
		try {
			connection = server.accept();

			output = new ObjectOutputStream(connection.getOutputStream());
			output.flush();
			input = new ObjectInputStream(connection.getInputStream());
		}
		catch(IOException ioException) {
			System.err.println("Error getting streams");
			closeConnection();
		}
	}