Home > other >  A static member function in the main (134217855) and a class member function (1778493632) have diffe
A static member function in the main (134217855) and a class member function (1778493632) have diffe

Time:11-04

Long CClientNet: : GetValidIP ()
{
Long lValidIP=inet_addr (" 127.0.0.8 ");

//get the current host name
Char szHostName [200].
: : gethostname (szHostName, sizeof (szHostName) - 1);

//get the current host address list
Hostent * phost=: : gethostbyname (szHostName);

//get a valid address
If (phost)
{
If (phost - & gt; H_addr_list [0] & amp; & Phost - & gt; H_length==4)
{
LValidIP=* (*) phost - & gt; H_addr_list [0].
}
}

Return lValidIP;
}
Every perform like that
And connect with the host server is only
A member function to get the IP that
10061 because the target machine actively refused, otherwise it is unable to connect,
  • Related