javacommons/gcfprotocols/socket/socket/src/nativesocketconnection.cpp
branchRCL_3
changeset 77 7cee158cb8cd
parent 19 04becd199f91
equal deleted inserted replaced
71:d5e927d5853b 77:7cee158cb8cd
   185         {
   185         {
   186             LOG1(ESOCKET, EInfo, "before getHostByName , mHost = %s" ,mHost);
   186             LOG1(ESOCKET, EInfo, "before getHostByName , mHost = %s" ,mHost);
   187             struct hostent* hp = gethostbyname(mHost);
   187             struct hostent* hp = gethostbyname(mHost);
   188             if (hp ==  NULL)
   188             if (hp ==  NULL)
   189             {
   189             {
   190                 return -(h_errno);
   190                  //error condition, we have to handle -18 error.
       
   191                 ELOG1(ESOCKET,"NativeSocketConnection:: gthostbyname error : %d" , h_errno);                 
       
   192                 int tmp = ApnSettings::retryConnection(h_errno,aType,aApn);
       
   193                 if(tmp == 0)
       
   194                 {
       
   195                     // connection reset done, attempt once again
       
   196                     hp = gethostbyname(mHost);
       
   197                     if(hp == NULL)
       
   198                     {
       
   199                         return -(h_errno);    
       
   200                     }
       
   201                  }
       
   202                  else
       
   203                  {
       
   204                      // retry not supported/failed
       
   205                      return tmp; 
       
   206                   
       
   207                  }
   191             }
   208             }
   192             addr.sin_addr.s_addr = ((struct in_addr*)(hp->h_addr))->s_addr;
   209             addr.sin_addr.s_addr = ((struct in_addr*)(hp->h_addr))->s_addr;
   193         }
   210         }
   194         LOG(ESOCKET, EInfo, "After getHostByName");
   211         LOG(ESOCKET, EInfo, "After getHostByName");
   195 
   212