src/cloud.c
static void cloud_finishConnect(CLOUD_SESSION_T *s)
{
   ssize_t retVal;
   fd_set writefds;
   struct timeval tv;

   FD_ZERO(&writefds);
   FD_SET(s->handle, &writefds);
   tv.tv_sec = CONN_TIMEOUT_MS / 1000;
   tv.tv_usec = 0;
   retVal = select(s->handle+1, NULL, &writefds, NULL, &tv);
   if (retVal >= 0)
   {
      if (FD_ISSET(s->handle, &writefds))
      {
         if (cloud_isSocketReady(s))
         {
            cloud_setSessionStatus(s, CLOUD_SESSION_CONNECT_SUCCESS);
         }
         else
         {
            cloud_setSessionStatus(s, CLOUD_SESSION_CONNECT_PENDING);
         }
      }
      else
      {
         utils_sysLog(LOG_ERR, "%s>> connect FD_ISSET errno: %s\n", s->name, strerror(errno));
         cloud_handleSocketError(s, errno);
      }
   }
   else
   {
      utils_sysLog(LOG_ERR, "%s>> connect select errno: %s\n", s->name, strerror(errno));
      cloud_handleSocketError(s, errno);
   }
}
//!
//! Cloud finish the session connect.
//!

Cloud finish the session connect.
Cloud finish the session connect .
static void cloud_finishConnect(CLOUD_SESSION_T *s)
{
   ssize_t retVal;
   fd_set writefds;
   struct timeval tv;
   FD_ZERO(&writefds);
   FD_SET(s->handle, &writefds);
   tv.tv_sec = CONN_TIMEOUT_MS / 1000;
   tv.tv_usec = 0;
   retVal = select(s->handle+1, NULL, &writefds, NULL, &tv);
   if (retVal >= 0)
   {
      if (FD_ISSET(s->handle, &writefds))
      {
         if (cloud_isSocketReady(s))
         {
            cloud_setSessionStatus(s, CLOUD_SESSION_CONNECT_SUCCESS);
         }
         else
         {
            cloud_setSessionStatus(s, CLOUD_SESSION_CONNECT_PENDING);
         }
      }
      else
      {
         utils_sysLog(LOG_ERR, "%s>> connect FD_ISSET errno: %s\n", s->name, strerror(errno));
         cloud_handleSocketError(s, errno);
      }
   }
   else
   {
      utils_sysLog(LOG_ERR, "%s>> connect select errno: %s\n", s->name, strerror(errno));
      cloud_handleSocketError(s, errno);
   }
}
static void cloud_finishConnect ( CLOUD_SESSION_T * s ) { ssize_t retVal ; fd_set writefds ; struct timeval tv ; FD_ZERO ( & writefds ) ; FD_SET ( s -> handle , & writefds ) ; tv . tv_sec = CONN_TIMEOUT_MS / 1000 ; tv . tv_usec = 0 ; retVal = select ( s -> handle + 1 , NULL , & writefds , NULL , & tv ) ; if ( retVal >= 0 ) { if ( FD_ISSET ( s -> handle , & writefds ) ) { if ( cloud_isSocketReady ( s ) ) { cloud_setSessionStatus ( s , CLOUD_SESSION_CONNECT_SUCCESS ) ; } else { cloud_setSessionStatus ( s , CLOUD_SESSION_CONNECT_PENDING ) ; } } else { utils_sysLog ( LOG_ERR , " \n " , s -> name , strerror ( errno ) ) ; cloud_handleSocketError ( s , errno ) ; } } else { utils_sysLog ( LOG_ERR , " \n " , s -> name , strerror ( errno ) ) ; cloud_handleSocketError ( s , errno ) ; } }
Cloud finish the session connect.
Cloud finish the session connect .