@Override
	public void run() {
		ServerSocket serverSocket = null;
		try {
			serverSocket = new ServerSocket(this.port);
			//If no haertbeat from worker process ... then timeout. 
			serverSocket.setSoTimeout(ACCEPT_TIMEOUT);
			while(true) {
				Socket clientSocket = null;
				try {
					clientSocket = serverSocket.accept();
					
					//Should this part be in a separate thread using thread pool or
					//can add retries in RegistryClient as that is the only place through
					//which clients will interact with the RegistryServer.
					ObjectInputStream ois = new ObjectInputStream(clientSocket.getInputStream());
					
					WorkerHeartbeat hb = (WorkerHeartbeat)ois.readObject();
					
					//System.out.println("Received heartbeat from worker");
					
					WorkerHeartbeatResponse response = handleHeartbeat(hb);
					
					ObjectOutputStream oos = new ObjectOutputStream(clientSocket.getOutputStream());
					oos.writeObject(response);
					oos.flush();
					
					ois.close();
					oos.close();
					clientSocket.close();
					
				} catch (InterruptedIOException timeout) { 
					startTaskRunner();
				} catch (Exception exc) {
					exc.printStackTrace();
				} finally {
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}