Changeset 168
- Timestamp:
- 03/20/09 00:04:05 (15 years ago)
- Location:
- vtcross/trunk/src/shell
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/src/shell/Makefile.am
r161 r168 6 6 7 7 shell_demo_SOURCES = cr_shell.cpp 8 shell_demo_LDADD = ../lib/tinyxml/libtinyxml.a 8 shell_demo_LDADD = ../lib/tinyxml/libtinyxml.a ../lib/socketcomm/libsocketcomm.a 9 9 -
vtcross/trunk/src/shell/cr_shell.cpp
r167 r168 223 223 n = recv(socket,buffer,i+1,0); 224 224 if (n < 0) 225 error("ERROR reading from socket");225 ERROR(1, "Error reading from socket!\n"); 226 226 // printf("ReadMessage:%s %d\n",buffer,n); 227 227 … … 239 239 n = send(socketfd,message.c_str(),(message.size()+1),0); 240 240 if (n<0) 241 error("Error sending to client\n");241 ERROR(1, "Error sending to client\n"); 242 242 if(n == 0) 243 print tf("Client closed the socket.\n");243 printf("Client closed the socket.\n"); 244 244 245 245 //printf("SendMessage:%s %d\n",message.c_str(),n); … … 255 255 //int32_t total_bytes; 256 256 257 print tf("Cognitive Radio:: Sending Radio Operating Profile to Cognitive Engine.\n\n");257 printf("Cognitive Radio:: Sending Radio Operating Profile to Cognitive Engine.\n\n"); 258 258 259 259 // utilities … … 513 513 int32_t clntSock; /* Socket descriptor for client */ 514 514 struct sockaddr_in echoClntAddr; 515 u nsignedint32_t clntLen;515 uint32_t clntLen; 516 516 517 517 /* Set the size of the in-out parameter */ … … 538 538 /* Create socket for incoming connections */ 539 539 if ((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) 540 DieWithError("socket() failed");540 ERROR(1, "socket() failed\n"); 541 541 542 542 /* Construct local address structure */ … … 548 548 /* Bind to the local address */ 549 549 if (bind(sock, (struct sockaddr *) &echoServAddr, sizeof(echoServAddr)) < 0) 550 DieWithError("bind() failed");550 ERROR(1, "bind() failed\n"); 551 551 552 552 /* Mark the socket so it will listen for incoming connections */