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);
