Index: vtcross/trunk/CR_shell/src/main_cognitive_radio.cpp
===================================================================
--- vtcross/trunk/CR_shell/src/main_cognitive_radio.cpp	(revision 90)
+++ vtcross/trunk/CR_shell/src/main_cognitive_radio.cpp	(revision 95)
@@ -59,4 +59,5 @@
 	for(i = 0; i < ce_info->numParameters; i++) {
 		cout << "Parameter:  " << pList[i]->name << endl;
+	printf("Radio Operation Profile has been sucessfully sent.\n");
 		cout << "       Units:   " << pList[i]->units << endl;
 		cout << "       Min:     " << pList[i]->min << endl;
@@ -115,5 +116,5 @@
 	}
 	ce_info->numUtilities = i;	
-	cout << "Parsed " << ce_info->numUtilities << " utilities." << endl;
+	cout << "Initialize:: Parsed " << ce_info->numUtilities << " utilities." << endl;
 
 	// Pull observable information from XML file.
@@ -157,5 +158,5 @@
 	}
 	ce_info->numObservables = i;	
-	cout << "Parsed " << ce_info->numObservables << " observables." << endl;
+	cout << "Initialize:: Parsed " << ce_info->numObservables << " observables." << endl;
 	
 
@@ -210,5 +211,5 @@
 	}
 	ce_info->numParameters = i;	
-	cout << "Parsed " << ce_info->numParameters << " parameters." << endl;
+	cout << "Initialize:: Parsed " << ce_info->numParameters << " parameters." << endl;
 	return 1;
 }
@@ -269,5 +270,5 @@
 	//int total_bytes;   
 
-	printf("Sending configuration to CE.\n");
+	printf("Sending Radio Operating Profile to Cognitive Engine.\n\n");
  
  	// utilities
@@ -319,12 +320,11 @@
 	}
 	
-	printf("Configuration sent, waiting for ACK...\n");
 	// Receive ACK for utils
     char buffer[256];
         string message;
 	n = ReceiveMessage(socketfd, buffer);
-    printf("%s\n", buffer);
+    //printf("%s\n", buffer);
         //cout << message << endl;
-	printf("ACK received.\n");
+	//printf("ACK received.\n");
 
 }
@@ -368,5 +368,4 @@
     }
 
-    printf("experience sent\n");
 }
 
@@ -389,15 +388,13 @@
     float var;
 
-    /*// utility
-    for (i = 0; i < ce_info->numUtilities; i++){
-        bzero(buffer,256);
-        ReceiveMessage(sockfd,buffer);
-        var = atof(buffer);
-        uList[i]->value = var;
-        printf("utility %s, value %f\n"
-                , uList[i]->name.c_str(), uList[i]->value);
-    }*/
-    
-    // paramter
+    // Send request optimization message followed by the current environment parameters.
+    /*
+    SendMessage(sockfd,"request"); 
+    for (i = 0; i < ce_info->numObservables; i++){
+        SendMessage(sockfd,..);
+    }
+    */
+
+    // Receive optimized values from the Cognitive Engine 
     for (i = 0; i < ce_info->numParameters; i++){
         bzero(buffer,256);
@@ -405,17 +402,6 @@
         var = atof(buffer);
         pList[i]->value = var;
-        printf("parameter %s, value %f\n"
-                , pList[i]->name.c_str(), pList[i]->value);
     }
 
-    /*// observable
-    for (i = 0; i < ce_info->numObservables; i++){
-        bzero(buffer,256);
-        ReceiveMessage(sockfd,buffer);
-        var = atof(buffer);
-        oList[i]->value = var;
-        printf("observable %s, value %f\n"
-                , oList[i]->name.c_str(), oList[i]->value);
-    }*/
 
     return 1;
@@ -476,4 +462,5 @@
 
 	// update ce with experience
+    printf("Sending Previous Experience to New Cognitive Engine.\n\n");
     UpdateCEExperience(socketfd, num_rows, num_cols, past_exp);	
 
@@ -484,5 +471,8 @@
    	// Start socket server
      	int sockfd, newsockfd, clilen;
+        int peer_len = sizeof(struct sockaddr);
      	struct sockaddr_in serv_addr, cli_addr;
+     	struct sockaddr_in peer;
+
 
      	// Setup server socket connection
@@ -507,4 +497,11 @@
           		error("ERROR on accept");
 
+        if(getpeername(newsockfd, (struct sockaddr *) &peer, (socklen_t*)&peer_len) == -1) {
+            perror("getpeername() failed");
+            return -1;
+        }
+
+        printf("Received a connection from a Cognitive Engine with IP address: %s\n\n",inet_ntoa(peer.sin_addr));
+
 		// Begin parsing the messages
 		StartMessaging(newsockfd, uList, pList, oList, ce_info);
@@ -541,7 +538,7 @@
 	}
 
-	cout << "Attemping to parse " << pFilename << "." << endl;
+	cout << "\n\nInitialize:: Attemping to parse " << pFilename << "." << endl;
 	parse_ce_config( &doc , uList, pList, oList, &ce_info);
-	cout << "Configuration file parsing completed." << endl;
+	cout << "Initialize:: Configuration file parsing completed.\n" << endl;
 
     //print_current_config(uList, pList, oList, &ce_info);
Index: vtcross/trunk/CR_shell/Makefile
===================================================================
--- vtcross/trunk/CR_shell/Makefile	(revision 66)
+++ vtcross/trunk/CR_shell/Makefile	(revision 95)
@@ -3,5 +3,5 @@
 #
 
-TESTS = cognitive_radio cognitive_engine
+TESTS = cognitive_radio
 #CTESTS = client
 all: $(TESTS) $(CTESTS)
@@ -15,5 +15,5 @@
 
 OBJS = tinyxml.o tinyxmlparser.o tinyxmlerror.o tinystr.o
-SOCKET_OBJS = ServerSocket.o Socket.o
+#SOCKET_OBJS = ServerSocket.o Socket.o
 #OBJS = cbr.o sqlite3.o utility.o cognitive_radio_test.o ezxml.o
 
@@ -23,6 +23,6 @@
 #		  src/utility.h src/cognitive_radio_test.h
 
-$(SOCKET_OBJS) : %.o : src/socket/%.cpp
-	$(CC) $(CFLAGS) -c $< -o $@
+#$(SOCKET_OBJS) : %.o : src/socket/%.cpp
+#	$(CC) $(CFLAGS) -c $< -o $@
 
 $(OBJS) : %.o : src/%.cpp $(HEADERS)
Index: vtcross/trunk/CR_engines/CBR/src/main_cognitive_engine.c
===================================================================
--- vtcross/trunk/CR_engines/CBR/src/main_cognitive_engine.c	(revision 89)
+++ vtcross/trunk/CR_engines/CBR/src/main_cognitive_engine.c	(revision 95)
@@ -285,5 +285,5 @@
     strcpy(buffer, "xml received");
     SendMessage(sockfd, buffer);
-    printf("xml reception done\n");
+    //printf("xml reception done\n");
     
     return 1;
@@ -306,4 +306,13 @@
 }
 
+int GetRequest(int sockfd)
+{
+    char buffer[256];
+
+	bzero(buffer,256);
+	ReadMessage(sockfd,buffer);
+
+    return 1;
+}
 
 int GetExperience(int sockfd, int num_rows, int num_cols, 
@@ -536,28 +545,19 @@
     // get xml info from server
     GetXMLFromServer(sockfd, uList, pList, oList, &ce_info);
-    print_current_config(uList, pList, oList, &ce_info); 
-
+    printf("Received Radio Operation Profile from Server Successfully.\n\n");
+    //print_current_config(uList, pList, oList, &ce_info); 
+    
+    
     // get experience size from server
     int num_rows, num_cols;
     GetExperienceSize(sockfd, &num_rows, &num_cols);
+    
     // get experience
     int i, j;
-    /*float **past_exp;
-    past_exp = (float **)malloc(sizeof(float)*num_rows);
-    for (i = 0; i< 1; i++){
-        past_exp[i] = (float*)malloc(sizeof(float)*num_cols);
-    }*/
     float past_exp[num_rows][num_cols];
     GetExperience(sockfd, num_rows, num_cols, past_exp);
-    for (i = 0; i < num_rows; i++){
-        printf("experience #%d:\n", i+1);
-        for (j = 0; j < num_cols; j++){
-        printf(" %f", past_exp[i][j]);
-        }
-        printf("\n");
-    }
-   
+    printf("Received Previous Radio Experience from Server Successfully.\n\n");
+    
     // calculate utility
-    
 
     // cbr operation
@@ -567,23 +567,19 @@
     num_cols = num_cols + ce_info.numObservables;
     num_cols = num_cols + 1;    // overall utility
-    printf("number of rows: %d, number of columns: %d\n",
-            num_rows, num_cols);
-    RunCBREngine(uList, pList, oList, &ce_info, num_cols, num_rows, 
+   
+    //while(1) {
+        
+        // Wait until request is received from server to perform optimization 
+        //printf("Waiting for Request for optimization from Server\n\n");
+        //GetRequest(sockfd);
+        //printf("Received optimization request from server\n\n");
+        RunCBREngine(uList, pList, oList, &ce_info, num_cols, num_rows, 
             past_exp);    
-    // print out results
-    //int i;
-    printf("search result: ");
-    for (i=0;i<ce_info.numUtilities; i++)
-        printf("%f, ",uList[i].value);
-    for (i=0;i<ce_info.numParameters; i++)
-        printf("%f, ",pList[i].value);
-    for (i=0;i<ce_info.numObservables; i++)
-        printf("%f, ",oList[i].value);
-    printf("\n");
-    
-    // send results back to server
-    SendCEResults(sockfd, uList, pList, oList, &ce_info);
-
-
-  return 0;
-}
+   
+        printf("Sending optimization results to server.\n\n");
+        // send results back to server
+        SendCEResults(sockfd, uList, pList, oList, &ce_info);
+    //}
+    
+    return 0;
+}
