Changeset 19507

Show
Ignore:
Timestamp:
09/18/08 20:01:44 (5 years ago)
Author:
mattn
Message:

check connect timeout.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/c/libmemcached-win32/libmemcached-0.23/libmemcached/memcached_connect.c

    r19479 r19507  
    283283            tv.tv_sec = 0; 
    284284            tv.tv_usec = ptr->root->connect_timeout; 
    285             error = select(0, &fds, NULL, NULL, &tv); 
     285            error = select(ptr->fd + 1, NULL, &fds, NULL, &tv); 
    286286 
    287287            if (error == 0)  
     
    302302              } 
    303303 
    304           if (ptr->root->retry_timeout) 
    305           { 
    306             struct timeval next_time; 
    307  
    308             gettimeofday(&next_time, NULL); 
    309             ptr->next_retry= next_time.tv_sec + ptr->root->retry_timeout; 
    310           } 
     304              if (ptr->root->retry_timeout) 
     305              { 
     306                struct timeval next_time; 
     307 
     308                gettimeofday(&next_time, NULL); 
     309                ptr->next_retry= next_time.tv_sec + ptr->root->retry_timeout; 
     310              } 
    311311              ptr->server_failure_counter+= 1; 
    312312              return MEMCACHED_ERRNO; 
     
    324324handle_retry: 
    325325          ptr->cached_errno= errno; 
     326#ifndef _WIN32 
    326327          close(ptr->fd); 
     328#else 
     329          closesocket(ptr->fd); 
     330#endif 
    327331          ptr->fd= -1; 
    328332          if (ptr->root->retry_timeout)