Changeset 216

Show
Ignore:
Timestamp:
03/26/09 13:40:19 (15 years ago)
Author:
bhilburn
Message:

Applying style/semantic fixes to socketcomm.cpp. Removed
unimplemented/unused function decleration from socketcomm.h.

Location:
vtcross/trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/include/vtcross/socketcomm.h

    r207 r216  
    2020void ReadMessage(int32_t socketFD, char* msgBuffer); 
    2121 
    22  
    2322/* TODO 
    2423 */ 
    2524//int32_t SendMessage(int32_t socketFD, char* message); 
    2625int32_t SendMessage(int32_t socketFD, const char* message) ; 
    27  
    2826 
    2927/* TODO 
     
    3230        struct Radio_Info *radio_info); 
    3331 
    34  
    3532/* TODO 
    3633 */ 
    3734int32_t GetRequest(int32_t socketFD, struct Parameter pList[], \ 
    3835        struct Radio_Info *radio_info); 
    39  
    4036 
    4137/* This is the original function that does what the above function is supposed 
     
    4440int32_t ClientSocket(const char* serverName, const char* portNumber); 
    4541 
    46  
    4742/* TODO 
    4843 */ 
    4944int32_t  AcceptTCPConnection(int32_t servSock); 
    50  
    5145 
    5246/* TODO 
     
    5448int32_t CreateTCPServerSocket(uint16_t port); 
    5549 
    56  
    5750/* TODO 
    5851 */ 
    59 void HandleTCPClient(int32_t socketfd, Utility* uList[], Parameter* pList[], \ 
    60         Observable* oList[], Radio_Info* radio_info); 
    61  
    6252int32_t InitializeTCPServerPort(int32_t servSock); 
    6353 
  • vtcross/trunk/src/lib/socketcomm/socketcomm.cpp

    r207 r216  
    210210    int32_t clientSocket = accept(serverSock, NULL, NULL); 
    211211    if(clientSocket < 0) {  
    212         //ERROR(1, "Could not establish connection with client socket.\n"); 
     212        LOG("ALERT: Could not establish connection with client socket.\n"); 
    213213        return -1; 
    214214    } 
     
    249249InitializeTCPServerPort(int32_t servSock) 
    250250{ 
    251  
    252251    int32_t rc, on = 1; 
    253252 
    254253    rc = setsockopt(servSock, SOL_SOCKET, SO_REUSEADDR, (char*)&on, sizeof(on)); 
    255     if(rc < 0) 
    256     { 
     254    if(rc < 0) { 
     255        shutdown(servSock, 2); 
     256        close(servSock); 
    257257        ERROR(1,"setsockopt() failed\n"); 
     258    } 
     259 
     260    rc = ioctl(servSock, FIONBIO, (char*)&on); 
     261    if(rc < 0) { 
     262        shutdown(servSock, 2); 
    258263        close(servSock); 
    259         return -1; 
    260     } 
    261  
    262     rc = ioctl(servSock, FIONBIO, (char*)&on); 
    263     if(rc < 0) 
    264     { 
    265264        ERROR(1,"ioctl() failed\n"); 
    266         close(servSock); 
    267         return -1; 
    268265    } 
    269266