Changeset 168

Show
Ignore:
Timestamp:
03/20/09 00:04:05 (15 years ago)
Author:
bhilburn
Message:

Making everything play nicely. Note that the shell is a huge mess right now...
it will compile, but its a long ways from being warning-free and tight code.

Location:
vtcross/trunk/src/shell
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/shell/Makefile.am

    r161 r168  
    66 
    77shell_demo_SOURCES = cr_shell.cpp 
    8 shell_demo_LDADD = ../lib/tinyxml/libtinyxml.a 
     8shell_demo_LDADD = ../lib/tinyxml/libtinyxml.a ../lib/socketcomm/libsocketcomm.a 
    99 
  • vtcross/trunk/src/shell/cr_shell.cpp

    r167 r168  
    223223    n = recv(socket,buffer,i+1,0); 
    224224    if (n < 0) 
    225         error("ERROR reading from socket"); 
     225        ERROR(1, "Error reading from socket!\n"); 
    226226    //    printf("ReadMessage:%s %d\n",buffer,n); 
    227227 
     
    239239    n = send(socketfd,message.c_str(),(message.size()+1),0); 
    240240    if (n<0) 
    241         error("Error sending to client\n"); 
     241        ERROR(1, "Error sending to client\n"); 
    242242    if(n == 0) 
    243         printtf("Client closed the socket.\n"); 
     243        printf("Client closed the socket.\n"); 
    244244 
    245245        //printf("SendMessage:%s %d\n",message.c_str(),n);       
     
    255255        //int32_t total_bytes;    
    256256 
    257         printtf("Cognitive Radio:: Sending Radio Operating Profile to Cognitive Engine.\n\n"); 
     257        printf("Cognitive Radio:: Sending Radio Operating Profile to Cognitive Engine.\n\n"); 
    258258  
    259259        // utilities 
     
    513513    int32_t clntSock;                    /* Socket descriptor for client */ 
    514514    struct sockaddr_in echoClntAddr; 
    515     unsigned int32_t clntLen; 
     515    uint32_t clntLen; 
    516516 
    517517    /* Set the size of the in-out parameter */ 
     
    538538    /* Create socket for incoming connections */ 
    539539    if ((sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) 
    540         DieWithError("socket() failed"); 
     540        ERROR(1, "socket() failed\n"); 
    541541       
    542542    /* Construct local address structure */ 
     
    548548    /* Bind to the local address */ 
    549549    if (bind(sock, (struct sockaddr *) &echoServAddr, sizeof(echoServAddr)) < 0) 
    550         DieWithError("bind() failed"); 
     550        ERROR(1, "bind() failed\n"); 
    551551 
    552552    /* Mark the socket so it will listen for incoming connections */