Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006


Socket Programming, we must employ to gethostbyname ()?

SOCKET Can not call this function normally.
Calling his return is a hostent structure, which is useful if a h_addr, we can give him to pay for the value of the country, can not be deployed? Do they normally do? By Frank.

Socket Programming, we must employ to gethostbyname ()?

Of course, you do not have this function, but under normal circumstances would not become more complicated, because you have to you from the socket definition Assignment.

Socket Programming, we must employ to gethostbyname ()?

PHost = gethostbyname (sHost);
If (pHost ====== NULL)
        {
Addr = inet_addr (sHost);
If (addr ====== NULL)
                {
Return 1;
                }
        }
Else
Addr = * ((unsigned long *) pHost->;h_addr);


SHost or which hosts (defined in /etc/hosts inside), or IP address



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com