public void sendMessage(Message message) {
		messages.put(message.getSequenceNumber(), message);
		try {
			outputStream.writeObject(message);
		} catch (IOException e) {
			ClientLogger
					.error(Client.class,
							RemoteResourcesLocalization
									.getMessage(
											RemoteResourcesMessages.Client_Error_UnableToSendMessage,
											new Object[] { hostname, port }), e);
			disconnect();
		} catch (NullPointerException e) {
			disconnect();
			try {
				connect();
				outputStream.writeObject(message);
			} catch (IOException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
		}

	}