if (ptr->root->connect_timeout)
{
flags= fcntl(ptr->fd, F_GETFL, 0);
if (ptr->root->connect_timeout)
{
flags= fcntl(ptr->fd, F_GETFL, 0);
if (errno == EINPROGRESS || /* nonblocking mode - first return, */
errno == EALREADY) /* nonblocking mode - subsequent returns */
{
if (errno == EINPROGRESS || /* nonblocking mode - first return, */
errno == EALREADY) /* nonblocking mode - subsequent returns */
{
int error= poll(fds, 1, ptr->root->connect_timeout);
if (error != 1 || fds[0].revents & POLLERR)
int error= poll(fds, 1, ptr->root->connect_timeout);
if (error != 1 || fds[0].revents & POLLERR)
(void)getsockopt(ptr->fd, SOL_SOCKET, SO_ERROR, &err, &len);
ptr->cached_errno= (err == 0) ? errno : err;
}
(void)getsockopt(ptr->fd, SOL_SOCKET, SO_ERROR, &err, &len);
ptr->cached_errno= (err == 0) ? errno : err;
}
LIBMEMCACHED_MEMCACHED_CONNECT_START();
/* both retry_timeout and server_failure_limit must be set in order to delay retrying a server on error. */
LIBMEMCACHED_MEMCACHED_CONNECT_START();
/* both retry_timeout and server_failure_limit must be set in order to delay retrying a server on error. */