Index: branches/fep_client_cpp/fep_client.cpp
===================================================================
--- branches/fep_client_cpp/fep_client.cpp	(revision 70)
+++ branches/fep_client_cpp/fep_client.cpp	(revision 71)
@@ -32,5 +32,5 @@
 {
 	int i, j; // i == line_index, j == lds_index
-
+	void *rv;
 	// Send one reply for every "line" in the FEP
 	for (i = 0; i < lines_size; i++)
@@ -40,6 +40,6 @@
 		// populate reply
 		fepReply.reply = SHORTPOLL;
-		fepReply.schedule = fepLine[i].schedule;
-		fepReply.lineinfo = fepLine[i].lineInfo;
+		fepReply.schedule = lines[i].schedule;
+		fepReply.lineinfo = lines[i].lineInfo;
 		fepReply.kind = (enum polltype) 0;
 		fepReply.flag = (enum replykind) 0;
@@ -47,10 +47,10 @@
 		/***********************************
 			 This is an update to an extern, this should happen on the Java driver side?? 
-		fepLine[i].schedleSeq += 1;
-		fepLine[i].globalSeq += 51;
+		lines[i].schedleSeq += 1;
+		lines[i].globalSeq += 51;
 		*/
 
-		fepReply.schedule_sequence = fepLine[i].schedleSeq;
-		fepReply.global_sequence = fepLine[i].globalSeq;
+		fepReply.schedule_sequence = lines[i].schedleSeq;
+		fepReply.global_sequence = lines[i].globalSeq;
 		/************************************
 			 Need to find out what appropriate schedule time is: look at uci_unix_simulation_time src code		
@@ -58,7 +58,7 @@
 			uci_unix_simulation_time(uci_simulation_time());	// GMT time
 		*/
-		fepReply.user_info1 = fepLine[i].lineNum;
-		fepReply.user_info2 = fepLine[i].lineNum;
-		fepReply.system_key = fepLine[i].systemKey;
+		fepReply.user_info1 = lines[i].lineNum;
+		fepReply.user_info2 = lines[i].lineNum;
+		fepReply.system_key = lines[i].systemKey;
 
 		fepReply.answers.size = 1;
@@ -66,8 +66,8 @@
 		
 		/* for each LDS in the Line.... (constructs the short_answer message) */
-		for (j = 0; j < fepLine[i].ldsNum; j++)
+		for (j = 0; j < lines[i].ldsNum; j++)
 		{
 			fep_shortanswer fsa;
-			int index = fepLine[i].ldsIndex[j];
+			int index = lines[i].ldsIndex[j];
 
 			// msg: oa, od, ldsMap[index].dataPack, od, ff
@@ -90,5 +90,5 @@
 			fsa.info.poll_user_info2 = 1;	//always 1
 			fsa.info.retries = 0;
-			fsa.info.status = REPLY_DONE;
+			fsa.info.status = (enum replystatus) 1;
 			
 			//fepReply.answers.fep_answer_list_u.shortp.answers[j] = fsa;	
@@ -96,5 +96,5 @@
 			
 			// send out data
-			printf("line=%d, lds=%d\n", fepLine[i].lineNum, ldsMap[index].drop);
+			printf("line=%d, lds=%d\n", lines[i].lineNum, ldsMap[index].drop);
 			rv = fep_reply_xfer_32(&fepReply, clnt);
 
@@ -107,5 +107,5 @@
 
 /* Creates an RPC Client which communicates with the ATMS through RPC Calls */
-CLIENT * create_client()
+CLIENT * create_client(char *host)
 {
 	CLIENT *clnt;
@@ -131,13 +131,17 @@
 void update_ATMS(char *host)
 {
-	CLIENT *clnt = create_client();
+	CLIENT *clnt = create_client(host);
 	
 	/* Load data to be xfered to ATMS */
-	FEP_LINE_LDS *lines;
-	int lines_size = load_lines(&lines, "./lines_atms.txt");
-	FEP_LDS *ldsMap = load_lds("./lds_atms.txt");
+	int lines_size;
+	FEP_LINE_LDS *lines = load_lines(&lines_size, "./lines_atms.txt");
+	LDS_LOOP *ldsMap = load_lds("./lds_atms.txt");
 
 	/* Transfer data to ATMS */
 	xfer_replys(clnt, lines, lines_size, ldsMap);
+
+	/* Free allocated memory */
+	free(lines);
+	free(ldsMap);
 
 	/* Destroy client */
