(file) Return to Socket.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/Socket.cpp between version 1.32 and 1.32.4.2

version 1.32, 2008/06/19 17:57:01 version 1.32.4.2, 2008/10/01 17:03:46
Line 39 
Line 39 
 #include <Pegasus/Common/Logger.h> #include <Pegasus/Common/Logger.h>
 #include <Pegasus/Common/System.h> #include <Pegasus/Common/System.h>
 #include <Pegasus/Common/Tracer.h> #include <Pegasus/Common/Tracer.h>
   #include <Pegasus/Common/Threads.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 51 
Line 52 
     Uint32 timeoutMilliseconds)     Uint32 timeoutMilliseconds)
 { {
     int connectResult;     int connectResult;
     PEGASUS_RETRY_SYSTEM_CALL(  #ifdef PEGASUS_OS_TYPE_WINDOWS
         ::connect(socket, address, addressLength), connectResult);      connectResult = ::connect(socket, address, addressLength);
   #else
       Boolean connectionAlreadyRefused = false;
       Uint32 maxConnectAttempts = 100;
       // Retry the connect() until it succeeds or it fails with an error other
       // than EINTR, EAGAIN (for Linux), or the first ECONNREFUSED (for HP-UX).
       while (((connectResult = ::connect(socket, address, addressLength)) == -1)
              && (maxConnectAttempts-- > 0)
              && ((errno == EINTR) || (errno == EAGAIN) ||
                  ((errno == ECONNREFUSED) && !connectionAlreadyRefused)))
       {
           if (errno == ECONNREFUSED)
           {
               connectionAlreadyRefused = true;
           }
           Threads::sleep(1);
       }
   #endif
  
     if (connectResult == 0)     if (connectResult == 0)
     {     {
Line 73 
Line 91 
             { timeoutMilliseconds/1000, timeoutMilliseconds%1000*1000 };             { timeoutMilliseconds/1000, timeoutMilliseconds%1000*1000 };
         int selectResult = -1;         int selectResult = -1;
  
   #ifdef PEGASUS_OS_TYPE_WINDOWS
           PEGASUS_RETRY_SYSTEM_CALL(
               select(FD_SETSIZE, NULL, &fdwrite, &fdwrite, &timeoutValue),
               selectResult);
   #else
         PEGASUS_RETRY_SYSTEM_CALL(         PEGASUS_RETRY_SYSTEM_CALL(
             select(FD_SETSIZE, NULL, &fdwrite, NULL, &timeoutValue),             select(FD_SETSIZE, NULL, &fdwrite, NULL, &timeoutValue),
             selectResult);             selectResult);
   #endif
         if (selectResult == 0)         if (selectResult == 0)
         {         {
             PEG_TRACE_CSTRING(TRC_HTTP, Tracer::LEVEL1,             PEG_TRACE_CSTRING(TRC_HTTP, Tracer::LEVEL1,


Legend:
Removed from v.1.32  
changed lines
  Added in v.1.32.4.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2