public Client connect(String hostName, int port)
			throws UnknownHostException, IOException {
		final Client client = new Client(hostName, port);
		client.connect();
		new Thread("Check device state") { //$NON-NLS-1$
			@Override
			public void run() {
				while (!client.isConnected()
						&& (client.getStatus() == Status.OK)) {
					try {
						Thread.sleep(100);
					} catch (InterruptedException e) {
						// do nothing
					}
				}
				if (client.getStatus() == Status.OK) {
					List<ClientChangedListener> copy = new ArrayList<ClientChangedListener>();
					copy.addAll(listeners);
					for (ClientChangedListener listener : copy) {
						listener.clientConnected(client);
					}
				}
			};
		}.start();
		clients.put(hostName + ":" + port, client); //$NON-NLS-1$
		return client;
	}