public void run() { 
        while(listening) {
			try {
				// listen on request as server
				//
                byte[] bufReceived = new byte[BUFFER_SIZE];                
                DatagramPacket serverPacket = new DatagramPacket(bufReceived, bufReceived.length);
                serverSocket.receive(serverPacket); 
                // parse received info.
				String received = new String(serverPacket.getData(), 0, serverPacket.getLength());
				// System.out.println("Received from " + serverPacket.getAddress().getHostName() + ":\n" + received);
				LinkedList<RoutingTable> receivedList = readReceived(received);
				// listen to get something new, update currentHost list
				// need lock somehow
				// LinkedList<DistanceVector[]> latest = currentHost;
				Hashtable<String, Vector<DistanceVector>> latest = currentHost;
				// current host source
				String[] hostFile = file.split("\\.dat");
				String start = hostFile[0];
				for(int i=0; i<receivedList.size(); i++) {
					RoutingTable rt = receivedList.get(i);
					// update cost
					if(latest.containsKey(start + "-" + rt.getDest())) {
						Vector<DistanceVector> dVector = latest.get(start + "-" + rt.getDest());
						int index = neighbors.indexOf(rt.getSource());
						double newCost = neighbor_pair.get(start + "-" + rt.getSource()) + rt.getCost();
						if(dVector.get(index).getCost() > newCost) {
							dVector.get(index).setCost(newCost);
							// System.out.println("Cost change to currentHost");
						}
					}
					else {
						if(start.equals(rt.getDest())) {
							// System.out.println("Nonsense same to same host");
							continue;
						}
						// add new dest
						else {
							Vector<DistanceVector> newVector = new Vector<DistanceVector>();							
							for(int k=0; k<neighbors.size(); k++) {
								newVector.add(new DistanceVector(start, neighbors.get(k), rt.getDest(), INFINITY));
							}
							int index = neighbors.indexOf(rt.getSource());
							// in-place replace
							newVector.set(index, new DistanceVector(start, rt.getSource(), rt.getDest(), neighbor_pair.get(start + "-" + rt.getSource()) + rt.getCost()));
							currentHost.put(start + "-" + rt.getDest(), newVector);
							// System.out.println("Added newLine into currentHost");
						}						
					}
				}			
				// figure out response and reuse buf as send carrier
				/*
				bufReceived = DVToRT(currentHost).getBytes(); 
				// send the response to the client at "address" and "port"
                InetAddress address = serverPacket.getAddress();
                int portNum = serverPacket.getPort();
                serverPacket = new DatagramPacket(bufReceived, bufReceived.length, address, portNum);
                serverSocket.send(serverPacket);
				*/
            } 
			catch(IOException e) {
                e.printStackTrace();
            }			
        }
        serverSocket.close();
    }