| iMatix home page | << | < | > | >> |
![]() Version 2.11 |
#include "sflsock.h" qbyte get_hostaddr (void)
Returns the current the host address as a 4-byte value in host format (not network format). Returns 0x7f000001 (loopback) if sockets are not supported or there was an error getting the current host IP address. If there are several IP addresses on the system, returns one arbitrary address.
{ #if (defined (DOES_SOCKETS)) struct hostent *phe; /* Host information entry */ phe = gethostbyname (get hostname ()); if (phe) return (*(qbyte *) (phe-> h_addr_list [0])); else return (htonl (SOCKET_LOOPBACK)); #else return (htonl (SOCKET_LOOPBACK)); #endif }
| << | < | > | >> |
![]() |