@Override
	public void executeTask() {
		

		/* Redundant code here in the event Server and Client start diverting. */
		try {
			/* NULL indicates no node was registered. */
			if (node != null) {
				
				Node mNode = new Client();
				
				switch(node.NODE) {
				case CLIENT:
					
					mNode = RoutingTable.getInstance().getPrimaryServer();
					
					if(RoutingTable.getInstance().registerClient((Client) node)) {
						mNode.addStringMessage("REGISTER_OKAY");
					} else {
						mNode.addStringMessage("REGISTRATION_ERROR");
					}
					
					break;
				case NODE:
					
					mNode.addStringMessage("Node " + node.getCurrentIP() + " did not have a NODE_TYPE");
					
					break;
				case SERVER:
					
					if(RoutingTable.getInstance().registerServer((Server) node)){
						mNode.addStringMessage("REGISTER_OKAY");
					} else {
						mNode.addStringMessage("REGISTRATION_ERROR");
					}
					
					break;
				default:
					break;
				
				}
				
				mNode.setDestinationIP(node.getCurrentIP());
				mNode.setDestinationPort(node.getDestinationPort());
				
				buffer = mNode.toBytes();
				dataGram = new DatagramPacket(buffer, buffer.length);
				dataGram.setPort(mNode.getDestinationPort());
				dataGram.setAddress(InetAddress
						.getByName(mNode.getDestinationIP()));
				SocketManager.getInstance().sendDatagram(dataGram);
			}
		}
		catch (IOException e) {
			e.printStackTrace();
		}

		stopTask();
	}