Windows Mobile 6.5
A version of this page is also available for

This structure is used by functions to store information about a given host, such as host name, IP address, and so forth. An application should never attempt to modify this structure or to free anything inside the structure. Furthermore, only one copy of this structure is allocated per thread, and an application should therefore copy any information that it needs before issuing any other Windows Sockets API calls.

struct hostent {
  char FAR* h_name;
  char FAR* FAR* h_aliases;
  short h_addrtype;
  short h_length;
  char FAR* FAR* h_addr_list;


Official name of the host computer. If using the DNS or similar resolution system, it is the fully qualified domain name (FQDN) that caused the server to return a reply. If using a local hosts file, it is the first entry after the IP address.


Null-terminated array of alternate names.


Type of address being returned.


Length of each address, in bytes.


Null-terminated list of addresses for the host. Addresses are returned in network byte order. The macro h_addr is defined to be h_addr_list[0] for compatibility with older software.

Windows Embedded CEWindows CE .NET 4.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions