Hello Laurent, I'm using gethostbyname() and I don't have any error even with the latest UWin version. As far as I can remember, this implementation is based on Windows implementation : - if the network is down, for the current host, gethostbyname() return the loopback instead of the Internet Address.
Can you give me the errno you get? Regards, Yves *yves* crespin t. +33.(0)6.86.42.86.81 [image: Skype:] yvescrespin [image: Linkedin] <%20%20%20%20%20%20http://fr.linkedin.com/in/yvescrespin> On Fri, Jul 30, 2010 at 10:57 AM, YAO laurent <[email protected]> wrote: > > Hi All, > > I have a C program that worked properly in the following environment after > compiling: > . Windows 2003 Server > . Visual C++ 6 Enterprise Edition compiler > . UWIN 4.1 > > Know, we changed the environment to: > . Windows 2003 Server > . Visual C++ 6 Enterprise Edition compiler > . UWIN 4.1 > > An this program is no more working after compiling in the UWIN environment. > I have an error generated after the following lines when calling the > gethostbyname() function: > > There is no problem when compiling. > > Can someone help me to solde this issue ? > > Regards. > > > /************************************************************************* > Get Host IP Address > > *************************************************************************/ > h_errno = 0 ; > zl_sHp = gethostbyname (zl_cHostName) ; > if (zl_sHp == NULL) > { > zl_cParm[0] = "103" ; > zl_cParm[1] = "gethostbyname KO" ; > zl_cParm[2] = __FILE__ ; > sprintf(zl_cLine, "%d", __LINE__ ) ; > zl_cParm[3] = zl_cLine ; > sprintf(zl_cErrno, "%d (errno) %d (h_errno)", errno, h_errno ) ; > zl_cParm[4] = zl_cErrno ; > zl_cParm[5] = zl_cHostName ; > plogx_LogEvent( ULOGK_ENTETE_WARNING , > PLOGK_GETHOSTBYNAME , > 6, > zl_cParm, > 0, > (char *)0 > ); > > close ( zl_nSockFd ) ; > continue ; > /* > fprintf(stderr, "%s: Host inconnu", zl_cHostName); > exit(2) ; > */ > } > /************************************************** > > > > > _______________________________________________ > uwin-users mailing list > [email protected] > https://mailman.research.att.com/mailman/listinfo/uwin-users > >
_______________________________________________ uwin-users mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/uwin-users
