```html Winsock Structures - MSDN Documentation

Winsock Structures

WSADATA

Contains information about the Windows Sockets implementation.

typedef struct WSAData {
    WORD         wVersion;
    WORD         wHighVersion;
    char         szDescription[257];
    char         szSystemStatus[129];
    unsigned short iMaxSockets;
    unsigned short iMaxUdpDg;
    char*        lpVendorInfo;
} WSADATA, *LPWSADATA;

SOCKADDR

Generic socket address structure.

typedef struct sockaddr {
    u_short sa_family;
    char    sa_data[14];
} SOCKADDR, *PSOCKADDR, *LPSOCKADDR;

SOCKADDR_IN

IPv4 socket address structure.

typedef struct sockaddr_in {
    short            sin_family;
    unsigned short   sin_port;
    struct in_addr   sin_addr;
    char             sin_zero[8];
} SOCKADDR_IN, *PSOCKADDR_IN;

SOCKADDR_IN6

IPv6 socket address structure.

typedef struct sockaddr_in6 {
    ADDRESS_FAMILY   sin6_family;
    USHORT           sin6_port;
    ULONG            sin6_flowinfo;
    IN6_ADDR         sin6_addr;
    ULONG            sin6_scope_id;
} SOCKADDR_IN6, *PSOCKADDR_IN6;

FD_SET

Structure used with the select function to monitor multiple sockets.

typedef struct fd_set {
    u_int    fd_count;
    SOCKET   fd_array[FD_SETSIZE];
} FD_SET, *PFD_SET;

timeval

Structure for time intervals used with select.

struct timeval {
    long tv_sec;   // seconds
    long tv_usec;  // microseconds
};

hostent

Structure describing an entry in the host database.

struct hostent {
    char  *h_name;        // official name of the host
    char **h_aliases;     // alias list
    short  h_addrtype;    // host address type
    short  h_length;      // length of address
    char **h_addr_list;   // list of addresses
};
#define h_addr h_addr_list[0] // for backward compatibility

Reference Table

StructureDescription
WSADATAVersion and implementation info
SOCKADDRGeneric address
SOCKADDR_INIPv4 address
SOCKADDR_IN6IPv6 address
FD_SETSocket set for select()
timevalTime interval for select()
hostentHost entry information
```