SOCKADDR

This structure is the generic address structure for all address families used in Windows socket communication.

At a Glance

Header file: Winsock.h
Windows CE versions: 1.0 and later

Syntax

struct sockaddr {
unsigned short
sa_family;
char
sa_data[14];
};

Remarks

The actual structure is interpreted differently in the context of different address families. The only requirements are that the first u_short is the address family and the total size of the memory buffer in bytes is namelen.

The structure below is used with TCP/IP. Other protocols use similar structures.

struct sockaddr_in {
 short sin_family;
 u_short sin_port;
 struct in_addr sin_addr;
 char sin_zero[8];
};

See Also

SOCKADDR_IN