Changeset 216 for vtcross/trunk/src/lib

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.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • 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