public void sendMessage(Message message) {
		String dest = message.getDest();
		Socket clientSocket = null;
		ObjectOutputStream outToServer = null;
		
		// Get connection socket and OutputStream
		if (connections.get(dest) != null) {
			// Get socket and ObjectOutputStrem if already stored for the destination
			clientSocket = connections.get(dest);
			outToServer = output.get(dest);
		} else {
			InetAddress destIP;
			// Create new socket for a new destination
			try {
				destIP = InetAddress.getByName(hostMap.get(dest).getIp());
				int destPort = hostMap.get(dest).getPort();
				
				clientSocket = new Socket(destIP, destPort); 
				outToServer = new ObjectOutputStream(clientSocket.getOutputStream());
				
				// Store socket and ObjectOutputStream for later use
				connections.put(dest, clientSocket);
				output.put(dest, outToServer);
			} catch (UnknownHostException e) {
				System.out.println("Host name is unkown!");
				e.printStackTrace();
			
			} catch (ConnectException e) {
				System.out.println("Cannot setup TCP connection");
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		
		// Write message to OutputStream
		if (outToServer != null) {
			try {
				System.out.print("-----" + message.getSrc().toUpperCase() + " Send to " + message.getDest().toUpperCase());
				System.out.println(": " +message.isDuplicateFlag() + " " + message.getMessageKind() + " " + message.getSequenceNum());
				outToServer.writeObject(message);
			} catch (Exception e) {
				// Release socket if connection break
				System.out.println("Cannot deliver message, perhaps pipe is broken");
				try {
					output.get(dest).close();
				} catch (IOException e1) {
					System.out.println("Cannot close the socket");
				}
				output.remove(dest);
				connections.remove(dest);
			}
		}
	}