void disconnect() {

		ClientLogger.info(Client.class, RemoteResourcesLocalization.getMessage(
				RemoteResourcesMessages.Client_Info_DisconnectingFromServer,
				new Object[] { hostname, port }), null);

		deviceChangesThread.cancel();
		for (String dataConnection : dataConnections.keySet()) {
			ClientConnectionManager.getInstance().stopDataConnection(this,
					dataConnection);
		}
		if (outputStream != null) {
			try {
				outputStream.close();
			} catch (IOException e) {
				// do nothing
			}
		}
		if (inputStream != null) {
			try {
				inputStream.close();
			} catch (IOException e) {
				// do nothing
			}
		}
		if (connection != null) {
			try {
				connection.close();
			} catch (IOException e) {
				// do nothing
			}
		}
		connection = null;
		outputStream = null;
		inputStream = null;
	}