@Override
	public void executeTask() {

		setTaskId("QueryRoutingTableTask");
		try {
			dataGramSocket = new DatagramSocket(PORT);
			dataGramSocket.setSoTimeout(5000); // 3 seconds

			selfClient = new Client();
			selfClient.setCurrentIP(InetAddress.getLocalHost().getHostName());
			selfClient.setRouterName(queryUserIP);
			selfClient.setHostname(InetAddress.getLocalHost().getHostName());
			selfClient.setReceivingPort(PORT);
			selfClient.setRouterPort(QueryRoutingTableTask.PORT);
			selfClient.setUsername("Client "
					+ InetAddress.getLocalHost().getHostName());
			selfClient.SERVER_COMMAND = COMMAND_TYPE.NULL;
			selfClient.ROUTERTABLE_COMMAND = COMMAND_TYPE.PING_PRIMARY_SERVER_NODE;
			selfClient.addStringMessage(queryUserIP);

			buffer = selfClient.toBytes();

			dataGram = new DatagramPacket(buffer, buffer.length);
			dataGram.setPort(RoutingTableServlet.LISTENING_PORT);
			dataGram.setAddress(InetAddress.getByName(DCServer.ROUTING_TABLE_IP));

			buffer = new byte[1024];

			receiveGram = new DatagramPacket(buffer, buffer.length);

			dataGramSocket.send(dataGram);
			dataGramSocket.receive(receiveGram);

			buffer = receiveGram.getData();

			Node node = Node.fromBytes(buffer);
			
			node.setCurrentIP(receiveGram.getAddress().getHostAddress());
			node.setHostname(receiveGram.getAddress().getHostName());
			node.setReceivingPort(dataGram.getPort());
			RoutingTable.getInstance().registerServer((Server) node);

			
			
			setStringData(new String(node.toBytes()));

			stopTask();

		} catch (SocketTimeoutException e) {
			dataGramSocket.close();
			if (count == 5) {
				stopTask();
			}
			++count;
			executeTask();
		} catch (SocketException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (UnknownHostException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		dataGramSocket.close();
	}